Struct miden_objects::notes::NoteHeader
source · pub struct NoteHeader { /* private fields */ }Expand description
Holds the strictly required, public information of a note.
See NoteId and NoteMetadata for additional details.
Implementations§
source§impl NoteHeader
impl NoteHeader
sourcepub fn new(note_id: NoteId, note_metadata: NoteMetadata) -> Self
pub fn new(note_id: NoteId, note_metadata: NoteMetadata) -> Self
Returns a new NoteHeader instantiated from the specified note ID and metadata.
sourcepub fn id(&self) -> NoteId
pub fn id(&self) -> NoteId
Returns the note’s identifier.
The NoteId value is both an unique identifier and a commitment to the note.
sourcepub fn metadata(&self) -> &NoteMetadata
pub fn metadata(&self) -> &NoteMetadata
Returns the note’s metadata.
Trait Implementations§
source§impl Clone for NoteHeader
impl Clone for NoteHeader
source§fn clone(&self) -> NoteHeader
fn clone(&self) -> NoteHeader
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 NoteHeader
impl Debug for NoteHeader
source§impl Deserializable for NoteHeader
impl Deserializable for NoteHeader
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 NoteHeader
impl From<&Note> for NoteHeader
source§impl From<&NoteHeader> for [Word; 2]
impl From<&NoteHeader> for [Word; 2]
source§fn from(note_header: &NoteHeader) -> Self
fn from(note_header: &NoteHeader) -> Self
Converts to this type from the input type.
source§impl From<&NoteHeader> for [Felt; 8]
impl From<&NoteHeader> for [Felt; 8]
source§fn from(note_header: &NoteHeader) -> Self
fn from(note_header: &NoteHeader) -> Self
Converts to this type from the input type.
source§impl From<&NoteHeader> for [u8; 64]
impl From<&NoteHeader> for [u8; 64]
source§fn from(note_header: &NoteHeader) -> Self
fn from(note_header: &NoteHeader) -> Self
Converts to this type from the input type.
source§impl From<&OutputNote> for NoteHeader
impl From<&OutputNote> for NoteHeader
source§fn from(value: &OutputNote) -> Self
fn from(value: &OutputNote) -> Self
Converts to this type from the input type.
source§impl From<Note> for NoteHeader
impl From<Note> for NoteHeader
source§impl From<NoteHeader> for [Word; 2]
impl From<NoteHeader> for [Word; 2]
source§fn from(note_header: NoteHeader) -> Self
fn from(note_header: NoteHeader) -> Self
Converts to this type from the input type.
source§impl From<NoteHeader> for [Felt; 8]
impl From<NoteHeader> for [Felt; 8]
source§fn from(note_header: NoteHeader) -> Self
fn from(note_header: NoteHeader) -> Self
Converts to this type from the input type.
source§impl From<NoteHeader> for [u8; 64]
impl From<NoteHeader> for [u8; 64]
source§fn from(note_header: NoteHeader) -> Self
fn from(note_header: NoteHeader) -> Self
Converts to this type from the input type.
source§impl From<OutputNote> for NoteHeader
impl From<OutputNote> for NoteHeader
source§fn from(value: OutputNote) -> Self
fn from(value: OutputNote) -> Self
Converts to this type from the input type.
source§impl PartialEq for NoteHeader
impl PartialEq for NoteHeader
source§fn eq(&self, other: &NoteHeader) -> bool
fn eq(&self, other: &NoteHeader) -> bool
This method tests for
self and other values to be equal, and is used
by ==.source§impl Serializable for NoteHeader
impl Serializable for NoteHeader
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
impl Copy for NoteHeader
impl Eq for NoteHeader
impl StructuralPartialEq for NoteHeader
Auto Trait Implementations§
impl Freeze for NoteHeader
impl RefUnwindSafe for NoteHeader
impl Send for NoteHeader
impl Sync for NoteHeader
impl Unpin for NoteHeader
impl UnwindSafe for NoteHeader
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