pub struct Lib<E = NOp>where
E: InstructionSet,{ /* private fields */ }
Expand description
AluVM executable code library
Implementations§
Source§impl<E> Lib<E>where
E: InstructionSet,
impl<E> Lib<E>where
E: InstructionSet,
Sourcepub fn with<I>(code: I) -> Result<Lib<E>, EncodeError>
pub fn with<I>(code: I) -> Result<Lib<E>, EncodeError>
Constructs library for the provided instructions by encoding them into bytecode
Sourcepub fn lib_hash(&self) -> LibHash
pub fn lib_hash(&self) -> LibHash
Returns hash identifier LibHash
, representing the library in a
unique way.
Lib hash is computed as SHA256 tagged hash of the serialized library bytecode.
Sourcepub fn byte_count(&self) -> u16
pub fn byte_count(&self) -> u16
Calculates length of bytecode encoding in bytes
Trait Implementations§
Auto Trait Implementations§
impl<E> Freeze for Lib<E>
impl<E> RefUnwindSafe for Lib<E>where
E: RefUnwindSafe,
impl<E> Send for Lib<E>where
E: Send,
impl<E> Sync for Lib<E>where
E: Sync,
impl<E> Unpin for Lib<E>where
E: Unpin,
impl<E> UnwindSafe for Lib<E>where
E: UnwindSafe,
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