alloy_sol_types::sol_data

Struct FixedBytes

Source
pub struct FixedBytes<const N: usize>;
Expand description

FixedBytes - bytesX

Trait Implementations§

Source§

impl<const N: usize> Clone for FixedBytes<N>

Source§

fn clone(&self) -> FixedBytes<N>

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<const N: usize> Debug for FixedBytes<N>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<const N: usize> EventTopic for FixedBytes<N>

Source§

fn topic_preimage_length(_: &Self::RustType) -> usize

The number of bytes this type occupies in another topic’s preimage, usually a multiple of 32. Read more
Source§

fn encode_topic_preimage(rust: &Self::RustType, out: &mut Vec<u8>)

Encodes this type as preimage bytes which are then hashed in complex types’ encode_topic. Read more
Source§

fn encode_topic(rust: &Self::RustType) -> WordToken

Indexed event parameter encoding. Read more
Source§

impl<const N: usize> SolType for FixedBytes<N>

Source§

const SOL_NAME: &'static str = ByteCount<N>::NAME

The name of this type in Solidity.
Source§

const ENCODED_SIZE: Option<usize> = _

The statically-known ABI-encoded size of the type. Read more
Source§

const PACKED_ENCODED_SIZE: Option<usize> = _

The statically-known Non-standard Packed Mode ABI-encoded size of the type. Read more
Source§

type RustType = FixedBytes<N>

The corresponding Rust type.
Source§

type Token<'a> = WordToken

The corresponding ABI token type. Read more
Source§

fn valid_token(token: &Self::Token<'_>) -> bool

Returns true if the given token can be detokenized with this type.
Source§

fn detokenize(token: Self::Token<'_>) -> Self::RustType

Detokenize this type’s value from the given token. Read more
Source§

const DYNAMIC: bool = _

Whether the ABI-encoded size is dynamic. Read more
Source§

fn sol_type_name() -> Cow<'static, str>

👎Deprecated since 0.6.3: use SOL_NAME instead
Returns the name of this type in Solidity.
Source§

fn abi_encoded_size<E: ?Sized + SolTypeValue<Self>>(rust: &E) -> usize

Calculate the ABI-encoded size of the data, counting both head and tail words. For a single-word type this will always be 32.
Source§

fn type_check(token: &Self::Token<'_>) -> Result<()>

Returns an error if the given token cannot be detokenized with this type.
Source§

fn tokenize<E: ?Sized + SolTypeValue<Self>>(rust: &E) -> Self::Token<'_>

Tokenizes the given value into this type’s token. Read more
Source§

fn eip712_data_word<E: ?Sized + SolTypeValue<Self>>(rust: &E) -> Word

Encode this data according to EIP-712 encodeData rules, and hash it if necessary. Read more
Source§

fn abi_packed_encoded_size<E: ?Sized + SolTypeValue<Self>>(rust: &E) -> usize

Returns the length of this value when ABI-encoded in Non-standard Packed Mode. Read more
Source§

fn abi_encode_packed_to<E: ?Sized + SolTypeValue<Self>>( rust: &E, out: &mut Vec<u8>, )

Non-standard Packed Mode ABI encoding. Read more
Source§

fn abi_encode_packed<E: ?Sized + SolTypeValue<Self>>(rust: &E) -> Vec<u8>

Non-standard Packed Mode ABI encoding. Read more
Source§

fn abi_encode<E: ?Sized + SolTypeValue<Self>>(rust: &E) -> Vec<u8>

Tokenizes and ABI-encodes the given value by wrapping it in a single-element sequence. Read more
Source§

fn abi_decode(data: &[u8], validate: bool) -> Result<Self::RustType>

Decodes this type’s value from an ABI blob by interpreting it as a single-element sequence. Read more
Source§

fn abi_decode_params<'de>( data: &'de [u8], validate: bool, ) -> Result<Self::RustType>
where Self::Token<'de>: TokenSeq<'de>,

Decodes this type’s value from an ABI blob by interpreting it as function parameters. Read more
Source§

fn abi_decode_sequence<'de>( data: &'de [u8], validate: bool, ) -> Result<Self::RustType>
where Self::Token<'de>: TokenSeq<'de>,

Decodes this type’s value from an ABI blob by interpreting it as a sequence. Read more
Source§

impl<const N: usize> Copy for FixedBytes<N>

Auto Trait Implementations§

§

impl<const N: usize> Freeze for FixedBytes<N>

§

impl<const N: usize> RefUnwindSafe for FixedBytes<N>

§

impl<const N: usize> Send for FixedBytes<N>

§

impl<const N: usize> Sync for FixedBytes<N>

§

impl<const N: usize> Unpin for FixedBytes<N>

§

impl<const N: usize> UnwindSafe for FixedBytes<N>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V