Struct miden_objects::notes::NoteDetails
source · pub struct NoteDetails { /* private fields */ }Expand description
Details of a note consisting of assets, script, inputs, and a serial number.
See super::Note for more details.
Implementations§
source§impl NoteDetails
impl NoteDetails
sourcepub fn new(assets: NoteAssets, recipient: NoteRecipient) -> Self
pub fn new(assets: NoteAssets, recipient: NoteRecipient) -> Self
Returns a new note created with the specified parameters.
sourcepub fn id(&self) -> NoteId
pub fn id(&self) -> NoteId
Returns the note’s unique identifier.
This value is both an unique identifier and a commitment to the note.
sourcepub fn assets(&self) -> &NoteAssets
pub fn assets(&self) -> &NoteAssets
Returns the note’s assets.
sourcepub fn serial_num(&self) -> Word
pub fn serial_num(&self) -> Word
Returns the note’s recipient serial_num, the secret required to consume the note.
sourcepub fn script(&self) -> &NoteScript
pub fn script(&self) -> &NoteScript
Returns the note’s recipient script which locks the assets of this note.
sourcepub fn inputs(&self) -> &NoteInputs
pub fn inputs(&self) -> &NoteInputs
Returns the note’s recipient inputs which customizes the script’s behavior.
sourcepub fn recipient(&self) -> &NoteRecipient
pub fn recipient(&self) -> &NoteRecipient
Returns the note’s recipient.
sourcepub fn nullifier(&self) -> Nullifier
pub fn nullifier(&self) -> Nullifier
Returns the note’s nullifier.
This is public data, used to prevent double spend.
sourcepub fn into_parts(self) -> (NoteAssets, NoteRecipient)
pub fn into_parts(self) -> (NoteAssets, NoteRecipient)
Decomposes note details into underlying assets and recipient.
Trait Implementations§
source§impl Clone for NoteDetails
impl Clone for NoteDetails
source§fn clone(&self) -> NoteDetails
fn clone(&self) -> NoteDetails
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 NoteDetails
impl Debug for NoteDetails
source§impl Deserializable for NoteDetails
impl Deserializable for NoteDetails
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 NoteDetails
impl From<&Note> for NoteDetails
source§impl From<&NoteDetails> for NoteId
impl From<&NoteDetails> for NoteId
source§fn from(note: &NoteDetails) -> Self
fn from(note: &NoteDetails) -> Self
Converts to this type from the input type.
source§impl From<&NoteDetails> for Nullifier
impl From<&NoteDetails> for Nullifier
source§fn from(note: &NoteDetails) -> Self
fn from(note: &NoteDetails) -> Self
Converts to this type from the input type.
source§impl From<Note> for NoteDetails
impl From<Note> for NoteDetails
source§impl From<NoteDetails> for NoteFile
impl From<NoteDetails> for NoteFile
source§fn from(details: NoteDetails) -> Self
fn from(details: NoteDetails) -> Self
Converts to this type from the input type.
source§impl PartialEq for NoteDetails
impl PartialEq for NoteDetails
source§fn eq(&self, other: &NoteDetails) -> bool
fn eq(&self, other: &NoteDetails) -> bool
This method tests for
self and other values to be equal, and is used
by ==.source§impl Serializable for NoteDetails
impl Serializable for NoteDetails
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 Eq for NoteDetails
impl StructuralPartialEq for NoteDetails
Auto Trait Implementations§
impl Freeze for NoteDetails
impl RefUnwindSafe for NoteDetails
impl Send for NoteDetails
impl Sync for NoteDetails
impl Unpin for NoteDetails
impl UnwindSafe for NoteDetails
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§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit)