pub struct Frame {
pub mode: FrameMode,
pub flags: u8,
pub target: FrameAddress,
pub limits: FrameLimits,
pub value: Uint<256, 4>,
pub data: Bytes,
}Expand description
A single EIP-8141 transaction frame.
Fields§
§mode: FrameModeThe frame execution mode.
flags: u8Frame flags. Bits 0-1 encode approval scope, bit 2 encodes atomic batching.
target: FrameAddressTarget account. An empty address resolves to the transaction sender.
limits: FrameLimitsIndependent execution and state gas limits for this frame.
value: Uint<256, 4>Wei value transferred by this frame. Non-zero value is valid only for SENDER frames.
data: BytesCalldata provided to the top-level frame call.
Implementations§
Source§impl Frame
impl Frame
Sourcepub const fn new(
mode: FrameMode,
flags: u8,
target: FrameAddress,
limits: FrameLimits,
value: Uint<256, 4>,
data: Bytes,
) -> Frame
pub const fn new( mode: FrameMode, flags: u8, target: FrameAddress, limits: FrameLimits, value: Uint<256, 4>, data: Bytes, ) -> Frame
Creates a new frame from raw field values, including both gas limits.
Sourcepub const fn target_address(&self) -> Option<Address>
pub const fn target_address(&self) -> Option<Address>
Returns the target address, or None when the frame resolves to the transaction sender.
Sourcepub const fn resolved_target(&self, sender: Address) -> Address
pub const fn resolved_target(&self, sender: Address) -> Address
Resolves the target, substituting the transaction sender for an empty target.
Sourcepub const fn allowed_scope(&self) -> ApprovalScope
pub const fn allowed_scope(&self) -> ApprovalScope
Returns the allowed approval scope encoded in this frame’s flags.
Sourcepub const fn is_atomic_batch(&self) -> bool
pub const fn is_atomic_batch(&self) -> bool
Returns true if this frame has the atomic batch flag set.
Sourcepub const fn has_reserved_flags(&self) -> bool
pub const fn has_reserved_flags(&self) -> bool
Returns true if any reserved flag bit is set, which makes the transaction invalid.
Sourcepub fn is_expiry_verifier(&self) -> bool
pub fn is_expiry_verifier(&self) -> bool
Returns true if this frame is an expiry verifier frame.
Classification depends only on the frame mode and target. Call
Self::has_valid_expiry_verifier_fields separately when validating the transaction.
Sourcepub fn has_valid_expiry_verifier_fields(&self) -> bool
pub fn has_valid_expiry_verifier_fields(&self) -> bool
Returns true if the constrained fields of an expiry verifier frame are valid.
Trait Implementations§
Source§impl<'arbitrary> Arbitrary<'arbitrary> for Frame
impl<'arbitrary> Arbitrary<'arbitrary> for Frame
Source§fn arbitrary(u: &mut Unstructured<'arbitrary>) -> Result<Frame, Error>
fn arbitrary(u: &mut Unstructured<'arbitrary>) -> Result<Frame, Error>
Self from the given unstructured data. Read moreSource§fn arbitrary_take_rest(u: Unstructured<'arbitrary>) -> Result<Frame, Error>
fn arbitrary_take_rest(u: Unstructured<'arbitrary>) -> Result<Frame, Error>
Self from the entirety of the given
unstructured data. Read moreSource§fn size_hint(depth: usize) -> (usize, Option<usize>)
fn size_hint(depth: usize) -> (usize, Option<usize>)
Unstructured this type
needs to construct itself. Read moreSource§fn try_size_hint(
depth: usize,
) -> Result<(usize, Option<usize>), MaxRecursionReached>
fn try_size_hint( depth: usize, ) -> Result<(usize, Option<usize>), MaxRecursionReached>
Unstructured this type
needs to construct itself. Read moreSource§impl BorshDeserialize for Frame
impl BorshDeserialize for Frame
fn deserialize_reader<__R>(reader: &mut __R) -> Result<Frame, Error>where
__R: Read,
Source§fn deserialize(buf: &mut &[u8]) -> Result<Self, Error>
fn deserialize(buf: &mut &[u8]) -> Result<Self, Error>
Source§fn try_from_slice(v: &[u8]) -> Result<Self, Error>
fn try_from_slice(v: &[u8]) -> Result<Self, Error>
fn try_from_reader<R>(reader: &mut R) -> Result<Self, Error>where
R: Read,
Source§impl BorshSerialize for Frame
impl BorshSerialize for Frame
Source§impl<'de> Deserialize<'de> for Frame
impl<'de> Deserialize<'de> for Frame
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<Frame, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<Frame, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
impl Eq for Frame
Source§impl Serialize for Frame
impl Serialize for Frame
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
impl StructuralPartialEq for Frame
Auto Trait Implementations§
impl !Freeze for Frame
impl RefUnwindSafe for Frame
impl Send for Frame
impl Sync for Frame
impl Unpin for Frame
impl UnsafeUnpin for Frame
impl UnwindSafe for Frame
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreimpl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Layout§
Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...) attributes. Please see the Rust Reference's “Type Layout” chapter for details on type layout guarantees.
Size: 104 bytes