pub struct ABI {
pub version: u8,
pub schema: String,
pub params: Vec<Param>,
}Expand description
Airnode ABI object that can be encoded into the vector of U256 and decoded from it
Fields§
§version: u8Id of the ABI version. It is always “1” so far
schema: StringSchema string. Each parameter is represented by a char
params: Vec<Param>List of ABI parameters.
Implementations§
Source§impl ABI
impl ABI
Sourcepub fn encode(&self) -> Result<Vec<U256>, EncodingError>
pub fn encode(&self) -> Result<Vec<U256>, EncodingError>
encodes ABI into vector or 256 bit values The function can encode up to 31 parameters (and 1 byte is used to encode the encoding version).
Sourcepub fn decode_with_schema(
schema: String,
data: &Vec<U256>,
strict: bool,
) -> Result<Self, DecodingError>
pub fn decode_with_schema( schema: String, data: &Vec<U256>, strict: bool, ) -> Result<Self, DecodingError>
decodes ABI from the vector or 256 bit values. This function can be used when data doesn’t contain schema, but you know it from the other source.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for ABI
impl<'de> Deserialize<'de> for ABI
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl StructuralPartialEq for ABI
Auto Trait Implementations§
impl Freeze for ABI
impl RefUnwindSafe for ABI
impl Send for ABI
impl Sync for ABI
impl Unpin for ABI
impl UnwindSafe for ABI
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more