OnNoteReceived

Trait OnNoteReceived 

Source
pub trait OnNoteReceived {
    // Required method
    fn on_note_received<'life0, 'async_trait>(
        &'life0 self,
        committed_note: CommittedNote,
        public_note: Option<InputNoteRecord>,
    ) -> Pin<Box<dyn Future<Output = Result<NoteUpdateAction, ClientError>> + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}

Required Methods§

Source

fn on_note_received<'life0, 'async_trait>( &'life0 self, committed_note: CommittedNote, public_note: Option<InputNoteRecord>, ) -> Pin<Box<dyn Future<Output = Result<NoteUpdateAction, ClientError>> + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Callback that gets executed when a new note is received as part of the sync response.

It receives:

  • The committed note received from the network.
  • An optional note record that corresponds to the state of the note in the network (only if the note is public).

It returns an enum indicating the action to be taken for the received note update. Whether the note updated should be committed, new public note inserted, or ignored.

Implementors§