pub trait Codec: Sized {
    // Required methods
    fn read(reader: &mut Reader<'_>) -> MayRevert<Self>;
    fn write(writer: &mut Writer, value: Self);
    fn has_static_size() -> bool;
    fn signature() -> String;

    // Provided method
    fn is_explicit_tuple() -> bool { ... }
}
Expand description

Data that can be encoded/encoded followiong the Solidity ABI Specification.

Required Methods§

source

fn read(reader: &mut Reader<'_>) -> MayRevert<Self>

source

fn write(writer: &mut Writer, value: Self)

source

fn has_static_size() -> bool

source

fn signature() -> String

Provided Methods§

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl Codec for bool

source§

fn read(reader: &mut Reader<'_>) -> MayRevert<Self>

source§

fn write(writer: &mut Writer, value: Self)

source§

fn has_static_size() -> bool

source§

fn signature() -> String

source§

impl Codec for u8

source§

fn read(reader: &mut Reader<'_>) -> MayRevert<Self>

source§

fn write(writer: &mut Writer, value: Self)

source§

fn has_static_size() -> bool

source§

fn signature() -> String

source§

impl Codec for u16

source§

fn read(reader: &mut Reader<'_>) -> MayRevert<Self>

source§

fn write(writer: &mut Writer, value: Self)

source§

fn has_static_size() -> bool

source§

fn signature() -> String

source§

impl Codec for u32

source§

fn read(reader: &mut Reader<'_>) -> MayRevert<Self>

source§

fn write(writer: &mut Writer, value: Self)

source§

fn has_static_size() -> bool

source§

fn signature() -> String

source§

impl Codec for u64

source§

fn read(reader: &mut Reader<'_>) -> MayRevert<Self>

source§

fn write(writer: &mut Writer, value: Self)

source§

fn has_static_size() -> bool

source§

fn signature() -> String

source§

impl Codec for u128

source§

fn read(reader: &mut Reader<'_>) -> MayRevert<Self>

source§

fn write(writer: &mut Writer, value: Self)

source§

fn has_static_size() -> bool

source§

fn signature() -> String

source§

impl Codec for ()

source§

fn read(_reader: &mut Reader<'_>) -> MayRevert<Self>

source§

fn write(_writer: &mut Writer, _value: Self)

source§

fn has_static_size() -> bool

source§

fn signature() -> String

source§

impl Codec for H256

source§

fn read(reader: &mut Reader<'_>) -> MayRevert<Self>

source§

fn write(writer: &mut Writer, value: Self)

source§

fn has_static_size() -> bool

source§

fn signature() -> String

source§

impl Codec for U256

source§

fn read(reader: &mut Reader<'_>) -> MayRevert<Self>

source§

fn write(writer: &mut Writer, value: Self)

source§

fn has_static_size() -> bool

source§

fn signature() -> String

source§

impl<T: Codec> Codec for Vec<T>

source§

fn read(reader: &mut Reader<'_>) -> MayRevert<Self>

source§

fn write(writer: &mut Writer, value: Self)

source§

fn has_static_size() -> bool

source§

fn signature() -> String

source§

impl<TupleElement0: Codec> Codec for (TupleElement0,)

source§

fn has_static_size() -> bool

source§

fn read(reader: &mut Reader<'_>) -> MayRevert<Self>

source§

fn write(writer: &mut Writer, value: Self)

source§

fn signature() -> String

source§

fn is_explicit_tuple() -> bool

source§

impl<TupleElement0: Codec, TupleElement1: Codec> Codec for (TupleElement0, TupleElement1)

source§

fn has_static_size() -> bool

source§

fn read(reader: &mut Reader<'_>) -> MayRevert<Self>

source§

fn write(writer: &mut Writer, value: Self)

source§

fn signature() -> String

source§

fn is_explicit_tuple() -> bool

source§

impl<TupleElement0: Codec, TupleElement1: Codec, TupleElement2: Codec> Codec for (TupleElement0, TupleElement1, TupleElement2)

source§

fn has_static_size() -> bool

source§

fn read(reader: &mut Reader<'_>) -> MayRevert<Self>

source§

fn write(writer: &mut Writer, value: Self)

source§

fn signature() -> String

source§

fn is_explicit_tuple() -> bool

source§

impl<TupleElement0: Codec, TupleElement1: Codec, TupleElement2: Codec, TupleElement3: Codec> Codec for (TupleElement0, TupleElement1, TupleElement2, TupleElement3)

source§

fn has_static_size() -> bool

source§

fn read(reader: &mut Reader<'_>) -> MayRevert<Self>

source§

fn write(writer: &mut Writer, value: Self)

source§

fn signature() -> String

source§

fn is_explicit_tuple() -> bool

source§

impl<TupleElement0: Codec, TupleElement1: Codec, TupleElement2: Codec, TupleElement3: Codec, TupleElement4: Codec> Codec for (TupleElement0, TupleElement1, TupleElement2, TupleElement3, TupleElement4)

source§

fn has_static_size() -> bool

source§

fn read(reader: &mut Reader<'_>) -> MayRevert<Self>

source§

fn write(writer: &mut Writer, value: Self)

source§

fn signature() -> String

source§

fn is_explicit_tuple() -> bool

source§

impl<TupleElement0: Codec, TupleElement1: Codec, TupleElement2: Codec, TupleElement3: Codec, TupleElement4: Codec, TupleElement5: Codec> Codec for (TupleElement0, TupleElement1, TupleElement2, TupleElement3, TupleElement4, TupleElement5)

source§

fn has_static_size() -> bool

source§

fn read(reader: &mut Reader<'_>) -> MayRevert<Self>

source§

fn write(writer: &mut Writer, value: Self)

source§

fn signature() -> String

source§

fn is_explicit_tuple() -> bool

source§

impl<TupleElement0: Codec, TupleElement1: Codec, TupleElement2: Codec, TupleElement3: Codec, TupleElement4: Codec, TupleElement5: Codec, TupleElement6: Codec> Codec for (TupleElement0, TupleElement1, TupleElement2, TupleElement3, TupleElement4, TupleElement5, TupleElement6)

source§

fn has_static_size() -> bool

source§

fn read(reader: &mut Reader<'_>) -> MayRevert<Self>

source§

fn write(writer: &mut Writer, value: Self)

source§

fn signature() -> String

source§

fn is_explicit_tuple() -> bool

source§

impl<TupleElement0: Codec, TupleElement1: Codec, TupleElement2: Codec, TupleElement3: Codec, TupleElement4: Codec, TupleElement5: Codec, TupleElement6: Codec, TupleElement7: Codec> Codec for (TupleElement0, TupleElement1, TupleElement2, TupleElement3, TupleElement4, TupleElement5, TupleElement6, TupleElement7)

source§

fn has_static_size() -> bool

source§

fn read(reader: &mut Reader<'_>) -> MayRevert<Self>

source§

fn write(writer: &mut Writer, value: Self)

source§

fn signature() -> String

source§

fn is_explicit_tuple() -> bool

source§

impl<TupleElement0: Codec, TupleElement1: Codec, TupleElement2: Codec, TupleElement3: Codec, TupleElement4: Codec, TupleElement5: Codec, TupleElement6: Codec, TupleElement7: Codec, TupleElement8: Codec> Codec for (TupleElement0, TupleElement1, TupleElement2, TupleElement3, TupleElement4, TupleElement5, TupleElement6, TupleElement7, TupleElement8)

source§

fn has_static_size() -> bool

source§

fn read(reader: &mut Reader<'_>) -> MayRevert<Self>

source§

fn write(writer: &mut Writer, value: Self)

source§

fn signature() -> String

source§

fn is_explicit_tuple() -> bool

source§

impl<TupleElement0: Codec, TupleElement1: Codec, TupleElement2: Codec, TupleElement3: Codec, TupleElement4: Codec, TupleElement5: Codec, TupleElement6: Codec, TupleElement7: Codec, TupleElement8: Codec, TupleElement9: Codec> Codec for (TupleElement0, TupleElement1, TupleElement2, TupleElement3, TupleElement4, TupleElement5, TupleElement6, TupleElement7, TupleElement8, TupleElement9)

source§

fn has_static_size() -> bool

source§

fn read(reader: &mut Reader<'_>) -> MayRevert<Self>

source§

fn write(writer: &mut Writer, value: Self)

source§

fn signature() -> String

source§

fn is_explicit_tuple() -> bool

source§

impl<TupleElement0: Codec, TupleElement1: Codec, TupleElement2: Codec, TupleElement3: Codec, TupleElement4: Codec, TupleElement5: Codec, TupleElement6: Codec, TupleElement7: Codec, TupleElement8: Codec, TupleElement9: Codec, TupleElement10: Codec> Codec for (TupleElement0, TupleElement1, TupleElement2, TupleElement3, TupleElement4, TupleElement5, TupleElement6, TupleElement7, TupleElement8, TupleElement9, TupleElement10)

source§

fn has_static_size() -> bool

source§

fn read(reader: &mut Reader<'_>) -> MayRevert<Self>

source§

fn write(writer: &mut Writer, value: Self)

source§

fn signature() -> String

source§

fn is_explicit_tuple() -> bool

source§

impl<TupleElement0: Codec, TupleElement1: Codec, TupleElement2: Codec, TupleElement3: Codec, TupleElement4: Codec, TupleElement5: Codec, TupleElement6: Codec, TupleElement7: Codec, TupleElement8: Codec, TupleElement9: Codec, TupleElement10: Codec, TupleElement11: Codec> Codec for (TupleElement0, TupleElement1, TupleElement2, TupleElement3, TupleElement4, TupleElement5, TupleElement6, TupleElement7, TupleElement8, TupleElement9, TupleElement10, TupleElement11)

source§

fn has_static_size() -> bool

source§

fn read(reader: &mut Reader<'_>) -> MayRevert<Self>

source§

fn write(writer: &mut Writer, value: Self)

source§

fn signature() -> String

source§

fn is_explicit_tuple() -> bool

source§

impl<TupleElement0: Codec, TupleElement1: Codec, TupleElement2: Codec, TupleElement3: Codec, TupleElement4: Codec, TupleElement5: Codec, TupleElement6: Codec, TupleElement7: Codec, TupleElement8: Codec, TupleElement9: Codec, TupleElement10: Codec, TupleElement11: Codec, TupleElement12: Codec> Codec for (TupleElement0, TupleElement1, TupleElement2, TupleElement3, TupleElement4, TupleElement5, TupleElement6, TupleElement7, TupleElement8, TupleElement9, TupleElement10, TupleElement11, TupleElement12)

source§

fn has_static_size() -> bool

source§

fn read(reader: &mut Reader<'_>) -> MayRevert<Self>

source§

fn write(writer: &mut Writer, value: Self)

source§

fn signature() -> String

source§

fn is_explicit_tuple() -> bool

source§

impl<TupleElement0: Codec, TupleElement1: Codec, TupleElement2: Codec, TupleElement3: Codec, TupleElement4: Codec, TupleElement5: Codec, TupleElement6: Codec, TupleElement7: Codec, TupleElement8: Codec, TupleElement9: Codec, TupleElement10: Codec, TupleElement11: Codec, TupleElement12: Codec, TupleElement13: Codec> Codec for (TupleElement0, TupleElement1, TupleElement2, TupleElement3, TupleElement4, TupleElement5, TupleElement6, TupleElement7, TupleElement8, TupleElement9, TupleElement10, TupleElement11, TupleElement12, TupleElement13)

source§

fn has_static_size() -> bool

source§

fn read(reader: &mut Reader<'_>) -> MayRevert<Self>

source§

fn write(writer: &mut Writer, value: Self)

source§

fn signature() -> String

source§

fn is_explicit_tuple() -> bool

source§

impl<TupleElement0: Codec, TupleElement1: Codec, TupleElement2: Codec, TupleElement3: Codec, TupleElement4: Codec, TupleElement5: Codec, TupleElement6: Codec, TupleElement7: Codec, TupleElement8: Codec, TupleElement9: Codec, TupleElement10: Codec, TupleElement11: Codec, TupleElement12: Codec, TupleElement13: Codec, TupleElement14: Codec> Codec for (TupleElement0, TupleElement1, TupleElement2, TupleElement3, TupleElement4, TupleElement5, TupleElement6, TupleElement7, TupleElement8, TupleElement9, TupleElement10, TupleElement11, TupleElement12, TupleElement13, TupleElement14)

source§

fn has_static_size() -> bool

source§

fn read(reader: &mut Reader<'_>) -> MayRevert<Self>

source§

fn write(writer: &mut Writer, value: Self)

source§

fn signature() -> String

source§

fn is_explicit_tuple() -> bool

source§

impl<TupleElement0: Codec, TupleElement1: Codec, TupleElement2: Codec, TupleElement3: Codec, TupleElement4: Codec, TupleElement5: Codec, TupleElement6: Codec, TupleElement7: Codec, TupleElement8: Codec, TupleElement9: Codec, TupleElement10: Codec, TupleElement11: Codec, TupleElement12: Codec, TupleElement13: Codec, TupleElement14: Codec, TupleElement15: Codec> Codec for (TupleElement0, TupleElement1, TupleElement2, TupleElement3, TupleElement4, TupleElement5, TupleElement6, TupleElement7, TupleElement8, TupleElement9, TupleElement10, TupleElement11, TupleElement12, TupleElement13, TupleElement14, TupleElement15)

source§

fn has_static_size() -> bool

source§

fn read(reader: &mut Reader<'_>) -> MayRevert<Self>

source§

fn write(writer: &mut Writer, value: Self)

source§

fn signature() -> String

source§

fn is_explicit_tuple() -> bool

source§

impl<TupleElement0: Codec, TupleElement1: Codec, TupleElement2: Codec, TupleElement3: Codec, TupleElement4: Codec, TupleElement5: Codec, TupleElement6: Codec, TupleElement7: Codec, TupleElement8: Codec, TupleElement9: Codec, TupleElement10: Codec, TupleElement11: Codec, TupleElement12: Codec, TupleElement13: Codec, TupleElement14: Codec, TupleElement15: Codec, TupleElement16: Codec> Codec for (TupleElement0, TupleElement1, TupleElement2, TupleElement3, TupleElement4, TupleElement5, TupleElement6, TupleElement7, TupleElement8, TupleElement9, TupleElement10, TupleElement11, TupleElement12, TupleElement13, TupleElement14, TupleElement15, TupleElement16)

source§

fn has_static_size() -> bool

source§

fn read(reader: &mut Reader<'_>) -> MayRevert<Self>

source§

fn write(writer: &mut Writer, value: Self)

source§

fn signature() -> String

source§

fn is_explicit_tuple() -> bool

source§

impl<TupleElement0: Codec, TupleElement1: Codec, TupleElement2: Codec, TupleElement3: Codec, TupleElement4: Codec, TupleElement5: Codec, TupleElement6: Codec, TupleElement7: Codec, TupleElement8: Codec, TupleElement9: Codec, TupleElement10: Codec, TupleElement11: Codec, TupleElement12: Codec, TupleElement13: Codec, TupleElement14: Codec, TupleElement15: Codec, TupleElement16: Codec, TupleElement17: Codec> Codec for (TupleElement0, TupleElement1, TupleElement2, TupleElement3, TupleElement4, TupleElement5, TupleElement6, TupleElement7, TupleElement8, TupleElement9, TupleElement10, TupleElement11, TupleElement12, TupleElement13, TupleElement14, TupleElement15, TupleElement16, TupleElement17)

source§

fn has_static_size() -> bool

source§

fn read(reader: &mut Reader<'_>) -> MayRevert<Self>

source§

fn write(writer: &mut Writer, value: Self)

source§

fn signature() -> String

source§

fn is_explicit_tuple() -> bool

Implementors§

source§

impl Codec for Address

source§

impl<K: Kind, S: Get<u32>> Codec for BoundedBytesString<K, S>

source§

impl<P, C> Codec for Convert<P, C>
where P: Codec + TryInto<C>, C: Codec + Into<P>,

source§

impl<T: Codec, S: Get<u32>> Codec for BoundedVec<T, S>