pub trait SolCall: Sized {
type Parameters<'a>: SolType<Token<'a> = Self::Token<'a>>;
type Token<'a>: TokenSeq<'a>;
type Return;
type ReturnTuple<'a>: SolType<Token<'a> = Self::ReturnToken<'a>>;
type ReturnToken<'a>: TokenSeq<'a>;
const SIGNATURE: &'static str;
const SELECTOR: [u8; 4];
Show 14 methods
// Required methods
fn new(tuple: <Self::Parameters<'_> as SolType>::RustType) -> Self;
fn tokenize(&self) -> Self::Token<'_>;
fn tokenize_returns(ret: &Self::Return) -> Self::ReturnToken<'_>;
fn abi_decode_returns(data: &[u8]) -> Result<Self::Return, Error>;
fn abi_decode_returns_validate(data: &[u8]) -> Result<Self::Return, Error>;
// Provided methods
fn abi_encoded_size(&self) -> usize { ... }
fn abi_decode_raw(data: &[u8]) -> Result<Self, Error> { ... }
fn abi_decode_raw_validate(data: &[u8]) -> Result<Self, Error> { ... }
fn abi_decode(data: &[u8]) -> Result<Self, Error> { ... }
fn abi_decode_validate(data: &[u8]) -> Result<Self, Error> { ... }
fn abi_encode_raw(&self, out: &mut Vec<u8>) { ... }
fn abi_encode(&self) -> Vec<u8> ⓘ { ... }
fn abi_encode_returns(ret: &Self::Return) -> Vec<u8> ⓘ { ... }
fn abi_encode_returns_tuple<'a, E>(e: &'a E) -> Vec<u8> ⓘ
where E: SolTypeValue<Self::ReturnTuple<'a>> { ... }
}Expand description
Required Associated Constants§
Required Associated Types§
Sourcetype Parameters<'a>: SolType<Token<'a> = Self::Token<'a>>
type Parameters<'a>: SolType<Token<'a> = Self::Token<'a>>
The underlying tuple type which represents this type’s arguments.
If this type has no arguments, this will be the unit type ().
Sourcetype ReturnTuple<'a>: SolType<Token<'a> = Self::ReturnToken<'a>>
type ReturnTuple<'a>: SolType<Token<'a> = Self::ReturnToken<'a>>
The underlying tuple type which represents this type’s return values.
If this type has no return values, this will be the unit type ().
Sourcetype ReturnToken<'a>: TokenSeq<'a>
type ReturnToken<'a>: TokenSeq<'a>
The returns’ corresponding TokenSeq type.
Required Methods§
Sourcefn new(tuple: <Self::Parameters<'_> as SolType>::RustType) -> Self
fn new(tuple: <Self::Parameters<'_> as SolType>::RustType) -> Self
Convert from the tuple type used for ABI encoding and decoding.
Sourcefn tokenize_returns(ret: &Self::Return) -> Self::ReturnToken<'_>
fn tokenize_returns(ret: &Self::Return) -> Self::ReturnToken<'_>
Tokenize the call’s return values.
Sourcefn abi_decode_returns(data: &[u8]) -> Result<Self::Return, Error>
fn abi_decode_returns(data: &[u8]) -> Result<Self::Return, Error>
ABI decode this call’s return values from the given slice.
Sourcefn abi_decode_returns_validate(data: &[u8]) -> Result<Self::Return, Error>
fn abi_decode_returns_validate(data: &[u8]) -> Result<Self::Return, Error>
ABI decode this call’s return values from the given slice, with validation.
This is the same as abi_decode_returns, but performs
validation checks on the decoded return tuple.
Provided Methods§
Sourcefn abi_encoded_size(&self) -> usize
fn abi_encoded_size(&self) -> usize
The size of the encoded data in bytes, without its selector.
Sourcefn abi_decode_raw(data: &[u8]) -> Result<Self, Error>
fn abi_decode_raw(data: &[u8]) -> Result<Self, Error>
ABI decode this call’s arguments from the given slice, without its selector.
Sourcefn abi_decode_raw_validate(data: &[u8]) -> Result<Self, Error>
fn abi_decode_raw_validate(data: &[u8]) -> Result<Self, Error>
ABI decode this call’s arguments from the given slice, without its selector, with validation.
This is the same as abi_decode_raw, but performs
validation checks on the decoded parameters tuple.
Sourcefn abi_decode(data: &[u8]) -> Result<Self, Error>
fn abi_decode(data: &[u8]) -> Result<Self, Error>
ABI decode this call’s arguments from the given slice, with the selector.
Sourcefn abi_decode_validate(data: &[u8]) -> Result<Self, Error>
fn abi_decode_validate(data: &[u8]) -> Result<Self, Error>
ABI decode this call’s arguments from the given slice, with the selector, with validation.
This is the same as abi_decode, but performs
validation checks on the decoded parameters tuple.
Sourcefn abi_encode_raw(&self, out: &mut Vec<u8>)
fn abi_encode_raw(&self, out: &mut Vec<u8>)
ABI encode the call to the given buffer without its selector.
Sourcefn abi_encode(&self) -> Vec<u8> ⓘ
fn abi_encode(&self) -> Vec<u8> ⓘ
ABI encode the call to the given buffer with its selector.
Sourcefn abi_encode_returns_tuple<'a, E>(e: &'a E) -> Vec<u8> ⓘwhere
E: SolTypeValue<Self::ReturnTuple<'a>>,
fn abi_encode_returns_tuple<'a, E>(e: &'a E) -> Vec<u8> ⓘwhere
E: SolTypeValue<Self::ReturnTuple<'a>>,
ABI encode the call’s return values.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".