pub struct WeirollScript {
pub commands: Vec<[u8; 32]>,
pub state: Vec<Vec<u8>>,
}Expand description
A complete Weiroll script ready for on-chain execution.
Produced by WeirollPlanner::plan. The
commands and state fields map directly to the two arguments of the
Weiroll executor’s execute(bytes32[],bytes[]) function.
§Example
use cow_weiroll::WeirollPlanner;
let planner = WeirollPlanner::new();
let script = planner.plan();
assert!(script.is_empty());
assert_eq!(script.command_count(), 0);
assert_eq!(script.state_slot_count(), 0);Fields§
§commands: Vec<[u8; 32]>Packed 32-byte command words (one per instruction).
state: Vec<Vec<u8>>ABI-encoded state slots (arguments and return-value buffers).
Implementations§
Source§impl WeirollScript
impl WeirollScript
Sourcepub const fn command_count(&self) -> usize
pub const fn command_count(&self) -> usize
Sourcepub const fn state_slot_count(&self) -> usize
pub const fn state_slot_count(&self) -> usize
Trait Implementations§
Source§impl Clone for WeirollScript
impl Clone for WeirollScript
Source§fn clone(&self) -> WeirollScript
fn clone(&self) -> WeirollScript
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for WeirollScript
impl RefUnwindSafe for WeirollScript
impl Send for WeirollScript
impl Sync for WeirollScript
impl Unpin for WeirollScript
impl UnsafeUnpin for WeirollScript
impl UnwindSafe for WeirollScript
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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>
Converts
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>
Converts
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