Struct miden_objects::notes::NoteEnvelope
source · pub struct NoteEnvelope { /* private fields */ }Expand description
Holds information that is relevant to the recipient of a note.
Contains:
- note_id: ID of the note that was created
- note_metadata: metadata of the note that was created. Metadata is padded with ZERO such that
it is four elements in size (a word). The metadata includes the following elements:
- sender
- tag
- num assets
- ZERO
Implementations§
source§impl NoteEnvelope
impl NoteEnvelope
sourcepub fn new(note_id: NoteId, note_metadata: NoteMetadata) -> Self
pub fn new(note_id: NoteId, note_metadata: NoteMetadata) -> Self
Creates a new NoteEnvelope object.
sourcepub fn metadata(&self) -> &NoteMetadata
pub fn metadata(&self) -> &NoteMetadata
Returns the metadata of the note that was created.
Trait Implementations§
source§impl Clone for NoteEnvelope
impl Clone for NoteEnvelope
source§fn clone(&self) -> NoteEnvelope
fn clone(&self) -> NoteEnvelope
Returns a copy 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 moresource§impl Debug for NoteEnvelope
impl Debug for NoteEnvelope
source§impl Deserializable for NoteEnvelope
impl Deserializable for NoteEnvelope
source§fn read_from<R: ByteReader>(
source: &mut R
) -> Result<Self, DeserializationError>
fn read_from<R: ByteReader>( source: &mut R ) -> Result<Self, DeserializationError>
Reads a sequence of bytes from the provided
source, attempts to deserialize these bytes
into Self, and returns the result. Read moresource§fn read_from_bytes(bytes: &[u8]) -> Result<Self, DeserializationError>
fn read_from_bytes(bytes: &[u8]) -> Result<Self, DeserializationError>
source§impl From<&Note> for NoteEnvelope
impl From<&Note> for NoteEnvelope
source§impl From<&NoteEnvelope> for [Word; 2]
impl From<&NoteEnvelope> for [Word; 2]
source§fn from(note_envelope: &NoteEnvelope) -> Self
fn from(note_envelope: &NoteEnvelope) -> Self
Converts to this type from the input type.
source§impl From<&NoteEnvelope> for [Felt; 8]
impl From<&NoteEnvelope> for [Felt; 8]
source§fn from(note_envelope: &NoteEnvelope) -> Self
fn from(note_envelope: &NoteEnvelope) -> Self
Converts to this type from the input type.
source§impl From<&NoteEnvelope> for [u8; 64]
impl From<&NoteEnvelope> for [u8; 64]
source§fn from(note_envelope: &NoteEnvelope) -> Self
fn from(note_envelope: &NoteEnvelope) -> Self
Converts to this type from the input type.
source§impl From<&OutputNote> for NoteEnvelope
impl From<&OutputNote> for NoteEnvelope
source§fn from(note_stub: &OutputNote) -> Self
fn from(note_stub: &OutputNote) -> Self
Converts to this type from the input type.
source§impl From<Note> for NoteEnvelope
impl From<Note> for NoteEnvelope
source§impl From<NoteEnvelope> for [Word; 2]
impl From<NoteEnvelope> for [Word; 2]
source§fn from(note_envelope: NoteEnvelope) -> Self
fn from(note_envelope: NoteEnvelope) -> Self
Converts to this type from the input type.
source§impl From<NoteEnvelope> for [Felt; 8]
impl From<NoteEnvelope> for [Felt; 8]
source§fn from(note_envelope: NoteEnvelope) -> Self
fn from(note_envelope: NoteEnvelope) -> Self
Converts to this type from the input type.
source§impl From<NoteEnvelope> for [u8; 64]
impl From<NoteEnvelope> for [u8; 64]
source§fn from(note_envelope: NoteEnvelope) -> Self
fn from(note_envelope: NoteEnvelope) -> Self
Converts to this type from the input type.
source§impl From<OutputNote> for NoteEnvelope
impl From<OutputNote> for NoteEnvelope
source§fn from(note_stub: OutputNote) -> Self
fn from(note_stub: OutputNote) -> Self
Converts to this type from the input type.
source§impl PartialEq for NoteEnvelope
impl PartialEq for NoteEnvelope
source§fn eq(&self, other: &NoteEnvelope) -> bool
fn eq(&self, other: &NoteEnvelope) -> bool
This method tests for
self and other values to be equal, and is used
by ==.source§impl Serializable for NoteEnvelope
impl Serializable for NoteEnvelope
source§fn write_into<W: ByteWriter>(&self, target: &mut W)
fn write_into<W: ByteWriter>(&self, target: &mut W)
Serializes
self into bytes and writes these bytes into the target.source§fn get_size_hint(&self) -> usize
fn get_size_hint(&self) -> usize
Returns an estimate of how many bytes are needed to represent self. Read more
source§impl ToEnvelope for NoteEnvelope
impl ToEnvelope for NoteEnvelope
fn id(&self) -> NoteId
fn metadata(&self) -> NoteMetadata
fn to_envelope(&self) -> NoteEnvelope
impl Copy for NoteEnvelope
impl Eq for NoteEnvelope
impl StructuralPartialEq for NoteEnvelope
Auto Trait Implementations§
impl RefUnwindSafe for NoteEnvelope
impl Send for NoteEnvelope
impl Sync for NoteEnvelope
impl Unpin for NoteEnvelope
impl UnwindSafe for NoteEnvelope
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