ink/codegen/trait_def/trait_message.rs
1// Copyright (C) Use Ink (UK) Ltd.
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7// http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
15/// Used as `payable` property guard for ink! trait messages.
16///
17/// # Note
18///
19/// When an ink! trait message is annotated with `#[ink(payable)]`
20/// a compile time check is generated by ink! to guard that the
21/// payability of the ink! trait message matches the payability of
22/// the same ink! message as defined by the ink! trait message.
23pub struct TraitMessagePayable<const IS_PAYABLE: bool>;
24
25/// Used as `selector` property guard for ink! trait messages.
26///
27/// # Note
28///
29/// When an ink! trait message is annotated with `#[ink(selector = ..)]`
30/// a compile time check is generated by ink! to guard that the
31/// selector of the ink! trait message matches the selector of
32/// the same ink! message as defined by the ink! trait message.
33pub struct TraitMessageSelector<const SELECTOR_ID: u32>;