#[repr(u8)]pub enum WeirollCommandFlags {
DelegateCall = 0,
Call = 1,
StaticCall = 2,
CallWithValue = 3,
}Expand description
Flags that modify the execution mode of a Weiroll command.
These correspond to the EVM opcodes used when the Weiroll executor
invokes each command’s target contract. The call-type variants live in
the lower 2 bits; combine them with the associated CALLTYPE_MASK,
EXTENDED_COMMAND, and TUPLE_RETURN constants using bitwise
operations.
§Example
use cow_weiroll::WeirollCommandFlags;
let flags = WeirollCommandFlags::Call;
assert_eq!(flags as u8, 0x01);
assert_eq!(flags as u8 & WeirollCommandFlags::CALLTYPE_MASK, WeirollCommandFlags::Call as u8,);Variants§
DelegateCall = 0
Execute via DELEGATECALL opcode (library calls).
Call = 1
Execute via CALL opcode (standard external calls).
StaticCall = 2
Execute via STATICCALL opcode (read-only calls).
CallWithValue = 3
Execute via CALL with an explicit value transfer; the first
argument is interpreted as the ETH value to send.
Implementations§
Source§impl WeirollCommandFlags
impl WeirollCommandFlags
Sourcepub const CALLTYPE_MASK: u8 = 0x03
pub const CALLTYPE_MASK: u8 = 0x03
Bitmask that isolates the call-type bits from other flag bits.
Sourcepub const EXTENDED_COMMAND: u8 = 0x40
pub const EXTENDED_COMMAND: u8 = 0x40
Marks an extended command that uses an additional 32-byte word for argument slot indices (internal use).
Sourcepub const TUPLE_RETURN: u8 = 0x80
pub const TUPLE_RETURN: u8 = 0x80
Signals that the return value should be ABI-wrapped as bytes
so that multi-return functions can be captured (internal use).
Trait Implementations§
Source§impl Clone for WeirollCommandFlags
impl Clone for WeirollCommandFlags
Source§fn clone(&self) -> WeirollCommandFlags
fn clone(&self) -> WeirollCommandFlags
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for WeirollCommandFlags
impl Debug for WeirollCommandFlags
Source§impl Hash for WeirollCommandFlags
impl Hash for WeirollCommandFlags
Source§impl PartialEq for WeirollCommandFlags
impl PartialEq for WeirollCommandFlags
impl Copy for WeirollCommandFlags
impl Eq for WeirollCommandFlags
impl StructuralPartialEq for WeirollCommandFlags
Auto Trait Implementations§
impl Freeze for WeirollCommandFlags
impl RefUnwindSafe for WeirollCommandFlags
impl Send for WeirollCommandFlags
impl Sync for WeirollCommandFlags
impl Unpin for WeirollCommandFlags
impl UnsafeUnpin for WeirollCommandFlags
impl UnwindSafe for WeirollCommandFlags
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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 more