pub struct LibId(/* private fields */);
Expand description
Unique identifier for an AluVM library.
Methods from Deref<Target = Array<u8, 32>>§
Trait Implementations§
Source§impl<'a, C, D> BytecodeRead<LibId> for Marshaller<'a, C, D>
impl<'a, C, D> BytecodeRead<LibId> for Marshaller<'a, C, D>
Source§fn pos(&self) -> u16
fn pos(&self) -> u16
Return the current byte offset of the cursor. Does not account for bits.
If the position is exactly at EOF, returns
None
.Source§fn seek(&mut self, byte_pos: u16) -> Result<u16, CodeEofError>
fn seek(&mut self, byte_pos: u16) -> Result<u16, CodeEofError>
Set the current cursor byte offset to the provided value if it is less than the underlying
buffer length. Read more
Source§fn read_2bits(&mut self) -> Result<u2, CodeEofError>
fn read_2bits(&mut self) -> Result<u2, CodeEofError>
Read two bits.
Source§fn read_3bits(&mut self) -> Result<u3, CodeEofError>
fn read_3bits(&mut self) -> Result<u3, CodeEofError>
Read three bits.
Source§fn read_4bits(&mut self) -> Result<u4, CodeEofError>
fn read_4bits(&mut self) -> Result<u4, CodeEofError>
Read four bits.
Source§fn read_5bits(&mut self) -> Result<u5, CodeEofError>
fn read_5bits(&mut self) -> Result<u5, CodeEofError>
Read five bits.
Source§fn read_6bits(&mut self) -> Result<u6, CodeEofError>
fn read_6bits(&mut self) -> Result<u6, CodeEofError>
Read six bits.
Source§fn read_7bits(&mut self) -> Result<u7, CodeEofError>
fn read_7bits(&mut self) -> Result<u7, CodeEofError>
Read seven bits.
Source§fn read_fixed<N, const LEN: usize>(
&mut self,
f: impl FnOnce([u8; LEN]) -> N,
) -> Result<N, CodeEofError>
fn read_fixed<N, const LEN: usize>( &mut self, f: impl FnOnce([u8; LEN]) -> N, ) -> Result<N, CodeEofError>
Read the fixed number of bytes and convert it into a result type. Read more
Source§fn read_bytes(
&mut self,
) -> Result<(Confined<Vec<u8>, amplify::::collection::confinement::SmallBlob::{constant#0}, amplify::::collection::confinement::SmallBlob::{constant#1}>, bool), CodeEofError>
fn read_bytes( &mut self, ) -> Result<(Confined<Vec<u8>, amplify::::collection::confinement::SmallBlob::{constant#0}, amplify::::collection::confinement::SmallBlob::{constant#1}>, bool), CodeEofError>
Read variable-length byte string. Read more
Source§fn check_aligned(&self)
fn check_aligned(&self)
Check if the current cursor position is aligned to the next byte. Read more
Source§impl<'a, C, D> BytecodeWrite<LibId> for Marshaller<'a, C, D>
impl<'a, C, D> BytecodeWrite<LibId> for Marshaller<'a, C, D>
Source§type Error = MarshallError
type Error = MarshallError
Error type returned during writing procedures.
Source§fn write_1bit(&mut self, data: u1) -> Result<(), MarshallError>
fn write_1bit(&mut self, data: u1) -> Result<(), MarshallError>
Write a single bit.
Source§fn write_2bits(&mut self, data: u2) -> Result<(), MarshallError>
fn write_2bits(&mut self, data: u2) -> Result<(), MarshallError>
Write two bits.
Source§fn write_3bits(&mut self, data: u3) -> Result<(), MarshallError>
fn write_3bits(&mut self, data: u3) -> Result<(), MarshallError>
Write three bits.
Source§fn write_4bits(&mut self, data: u4) -> Result<(), MarshallError>
fn write_4bits(&mut self, data: u4) -> Result<(), MarshallError>
Write four bits.
Source§fn write_5bits(&mut self, data: u5) -> Result<(), MarshallError>
fn write_5bits(&mut self, data: u5) -> Result<(), MarshallError>
Write five bits.
Source§fn write_6bits(&mut self, data: u6) -> Result<(), MarshallError>
fn write_6bits(&mut self, data: u6) -> Result<(), MarshallError>
Write six bits.
Source§fn write_7bits(&mut self, data: u7) -> Result<(), MarshallError>
fn write_7bits(&mut self, data: u7) -> Result<(), MarshallError>
Write seven bits.
Source§fn write_byte(&mut self, data: u8) -> Result<(), MarshallError>
fn write_byte(&mut self, data: u8) -> Result<(), MarshallError>
Write byte.
Source§fn write_word(&mut self, data: u16) -> Result<(), MarshallError>
fn write_word(&mut self, data: u16) -> Result<(), MarshallError>
Write word.
Source§fn write_fixed<const LEN: usize>(
&mut self,
data: [u8; LEN],
) -> Result<(), <Marshaller<'a, C, D> as BytecodeWrite<LibId>>::Error>
fn write_fixed<const LEN: usize>( &mut self, data: [u8; LEN], ) -> Result<(), <Marshaller<'a, C, D> as BytecodeWrite<LibId>>::Error>
Write data representable as a fixed-length byte array.
Source§fn write_bytes(
&mut self,
data: &[u8],
) -> Result<(), <Marshaller<'a, C, D> as BytecodeWrite<LibId>>::Error>
fn write_bytes( &mut self, data: &[u8], ) -> Result<(), <Marshaller<'a, C, D> as BytecodeWrite<LibId>>::Error>
Write variable-length byte string.
Source§fn write_ref(
&mut self,
id: LibId,
) -> Result<(), <Marshaller<'a, C, D> as BytecodeWrite<LibId>>::Error>
fn write_ref( &mut self, id: LibId, ) -> Result<(), <Marshaller<'a, C, D> as BytecodeWrite<LibId>>::Error>
Write external reference id.
Source§fn check_aligned(&self)
fn check_aligned(&self)
Check if the current cursor position is aligned to the next byte. Read more
Source§impl CommitmentId for LibId
impl CommitmentId for LibId
Source§impl<'de> Deserialize<'de> for LibId
impl<'de> Deserialize<'de> for LibId
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<LibId, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<LibId, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl DisplayBaid64 for LibId
impl DisplayBaid64 for LibId
const HRI: &'static str = "alu"
const CHUNKING: bool = true
const PREFIX: bool = true
const EMBED_CHECKSUM: bool = false
const MNEMONIC: bool = true
fn to_baid64_payload(&self) -> [u8; 32]
const CHUNK_FIRST: usize = 8usize
const CHUNK_LEN: usize = 7usize
fn to_baid64_string(&self) -> String
fn to_baid64_mnemonic(&self) -> String
fn display_baid64(&self) -> Baid64Display<LEN>
fn fmt_baid64(&self, f: &mut Formatter<'_>) -> Result<(), Error>
Source§impl FromBaid64Str for LibId
impl FromBaid64Str for LibId
fn from_baid64_str(s: &str) -> Result<Self, Baid64ParseError>
Source§impl Ord for LibId
impl Ord for LibId
Source§impl PartialOrd for LibId
impl PartialOrd for LibId
Source§impl Serialize for LibId
impl Serialize for LibId
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,
Serialize this value into the given Serde serializer. Read more
Source§impl StrictDecode for LibId
impl StrictDecode for LibId
fn strict_decode(reader: &mut impl TypedRead) -> Result<LibId, DecodeError>
fn strict_read(reader: impl ReadRaw) -> Result<Self, DecodeError>
Source§impl StrictEncode for LibId
impl StrictEncode for LibId
fn strict_encode<W>(&self, writer: W) -> Result<W, Error>where
W: TypedWrite,
fn strict_write(&self, writer: impl WriteRaw) -> Result<(), Error>
Source§impl StrictTuple for LibId
impl StrictTuple for LibId
const FIELD_COUNT: u8 = 1u8
fn strict_check_fields()
fn strict_type_info() -> TypeInfo<Self>
Source§impl StrictType for LibId
impl StrictType for LibId
const STRICT_LIB_NAME: &'static str = LIB_NAME_ALUVM
fn strict_name() -> Option<TypeName>
Source§impl Wrapper for LibId
impl Wrapper for LibId
Source§fn from_inner(inner: <LibId as Wrapper>::Inner) -> LibId
fn from_inner(inner: <LibId as Wrapper>::Inner) -> LibId
Instantiates wrapper type with the inner data
Source§fn as_inner(&self) -> &<LibId as Wrapper>::Inner
fn as_inner(&self) -> &<LibId as Wrapper>::Inner
Returns reference to the inner representation for the wrapper type
impl Copy for LibId
impl Eq for LibId
impl SiteId for LibId
impl StrictProduct for LibId
impl StructuralPartialEq for LibId
Auto Trait Implementations§
impl Freeze for LibId
impl RefUnwindSafe for LibId
impl Send for LibId
impl Sync for LibId
impl Unpin for LibId
impl UnwindSafe for LibId
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<Id, const LEN: usize, const REVERSE_STR: bool> ByteArray<LEN> for Id
impl<Id, const LEN: usize, const REVERSE_STR: bool> ByteArray<LEN> for Id
Source§fn from_byte_array(val: impl Into<[u8; LEN]>) -> Id
fn from_byte_array(val: impl Into<[u8; LEN]>) -> Id
Constructs a wrapper type around a byte array.
Source§fn from_slice(slice: impl AsRef<[u8]>) -> Result<Id, FromSliceError>
fn from_slice(slice: impl AsRef<[u8]>) -> Result<Id, FromSliceError>
Constructs a byte array from the slice. Errors if the slice length
doesn’t match
LEN
constant generic.Source§fn to_byte_array(&self) -> [u8; LEN]
fn to_byte_array(&self) -> [u8; LEN]
Returns a byte array representation stored in the wrapped type.
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.