[−][src]Struct near_bindgen_core::AttrSigInfo
Information extracted from method attributes and signature.
Fields
ident: Ident
The name of the method.
non_bindgen_attrs: Vec<Attribute>
Attributes not related to bindgen.
args: Vec<ArgInfo>
All arguments of the method.
is_init: bool
Whether method can be used as initializer.
input_serializer: SerializerType
The serializer that we use for env::input()
.
result_serializer: SerializerType
The serializer that we use for the return type.
receiver: Option<Receiver>
The receiver, like mut self
, self
, &mut self
, &self
, or None
.
returns: ReturnType
What this function returns.
original_sig: Signature
The original code of the method.
Methods
impl AttrSigInfo
[src]
pub fn input_struct(&self) -> TokenStream2
[src]
Create struct representing input arguments.
Each argument is getting converted to a field in a struct. Specifically argument:
ATTRIBUTES ref mut binding @ SUBPATTERN : TYPE
is getting converted to:
binding: SUBTYPE,
where TYPE
is one of the following: & SUBTYPE
, &mut SUBTYPE
, SUBTYPE
,
and SUBTYPE
is one of the following: [T; n]
, path like
std::collections::HashMap<SUBTYPE, SUBTYPE>
, or tuple (SUBTYPE0, SUBTYPE1, ...)
.
Example
struct Input { arg0: Vec<String>, arg1: [u64; 10], arg2: (u64, Vec<String>), }
pub fn decomposition_pattern(&self) -> TokenStream2
[src]
Create pattern that decomposes input struct using correct mutability modifiers.
Example:
Input { arg0, mut arg1, arg2 }
pub fn constructor_expr(&self) -> TokenStream2
[src]
Create expression that constructs the struct.
Example:
Input { arg0, arg1, arg2, }
pub fn arg_list(&self) -> TokenStream2
[src]
Create a sequence of arguments that can be used to call the method or the function of the smart contract.
Example:
a, &b, &mut c,
pub fn pat_type_list(&self) -> TokenStream2
[src]
Create a sequence of patterns and types to be used in the method signature.
Example:
a: u64, b: &mut T, ref mut c: Vec<String>,
pub fn callback_deserialization(&self) -> TokenStream2
[src]
Create code that deserializes arguments that were decorated with #[callback]
pub fn callback_vec_deserialization(&self) -> TokenStream2
[src]
Create code that deserializes arguments that were decorated with #[callback_vec]
.
impl AttrSigInfo
[src]
pub fn new(
original_attrs: &mut Vec<Attribute>,
original_sig: &mut Signature
) -> Result<Self>
[src]
original_attrs: &mut Vec<Attribute>,
original_sig: &mut Signature
) -> Result<Self>
Process the method and extract information important for near-bindgen.
pub fn input_args(&self) -> impl Iterator<Item = &ArgInfo>
[src]
Only get args that correspond to env::input()
.
Auto Trait Implementations
impl !RefUnwindSafe for AttrSigInfo
impl !Send for AttrSigInfo
impl !Sync for AttrSigInfo
impl Unpin for AttrSigInfo
impl UnwindSafe for AttrSigInfo
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,