aztec-nr - noir_aztec::note::note_emission

Struct OuterNoteEmission

pub struct OuterNoteEmission<Note> {
    pub content_option: Option<NoteEmissionContent<Note>>,
    /* private fields */
}

A struct wrapping note emission in Option<T>. This is the struct provided to application codes, which can be used to emit only when a note was actually inserted. It is fairly common to have cases where a function conditionally inserts, and this allows us to keep the same API for emission in both cases (e.g. inserting a change note in a token's transfer function only when there is "change" left).

Fields

content_option: Option<NoteEmissionContent<Note>>

Implementations

impl<Note> OuterNoteEmission<Note>

pub fn new( content_option: Option<NoteEmissionContent<Note>>, context: &mut PrivateContext, ) -> Self
where Note: NoteType, Note: Packable
pub fn emit(self, recipient: AztecAddress, delivery_mode: u8)
where Note: NoteType, Note: Packable
pub fn discard(_self: Self)
where Note: NoteType, Note: Packable