Skip to main content

NoteTransportClient

Trait NoteTransportClient 

Source
pub trait NoteTransportClient: Send + Sync {
    // Required methods
    fn send_note<'life0, 'async_trait>(
        &'life0 self,
        header: NoteHeader,
        details: Vec<u8>,
    ) -> Pin<Box<dyn Future<Output = Result<(), NoteTransportError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn fetch_notes<'life0, 'life1, 'async_trait>(
        &'life0 self,
        tag: &'life1 [NoteTag],
        cursor: NoteTransportCursor,
    ) -> Pin<Box<dyn Future<Output = Result<(Vec<NoteInfo>, NoteTransportCursor), NoteTransportError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn stream_notes<'life0, 'async_trait>(
        &'life0 self,
        tag: NoteTag,
        cursor: NoteTransportCursor,
    ) -> Pin<Box<dyn Future<Output = Result<Box<dyn NoteStream>, NoteTransportError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;

    // Provided method
    fn send_note_with_block_hint<'life0, 'async_trait>(
        &'life0 self,
        header: NoteHeader,
        details: Vec<u8>,
        _block_hint: BlockNumber,
    ) -> Pin<Box<dyn Future<Output = Result<(), NoteTransportError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait { ... }
}
Expand description

The main transport client trait for sending and receiving encrypted notes

Required Methods§

Source

fn send_note<'life0, 'async_trait>( &'life0 self, header: NoteHeader, details: Vec<u8>, ) -> Pin<Box<dyn Future<Output = Result<(), NoteTransportError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Send a note with optionally encrypted details

Source

fn fetch_notes<'life0, 'life1, 'async_trait>( &'life0 self, tag: &'life1 [NoteTag], cursor: NoteTransportCursor, ) -> Pin<Box<dyn Future<Output = Result<(Vec<NoteInfo>, NoteTransportCursor), NoteTransportError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Fetch notes for given tags

Downloads notes for given tags. Returns notes labelled after the provided cursor (pagination), and an updated cursor.

Source

fn stream_notes<'life0, 'async_trait>( &'life0 self, tag: NoteTag, cursor: NoteTransportCursor, ) -> Pin<Box<dyn Future<Output = Result<Box<dyn NoteStream>, NoteTransportError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Stream notes for a given tag

Provided Methods§

Source

fn send_note_with_block_hint<'life0, 'async_trait>( &'life0 self, header: NoteHeader, details: Vec<u8>, _block_hint: BlockNumber, ) -> Pin<Box<dyn Future<Output = Result<(), NoteTransportError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Send a note, relaying a block hint for the recipient’s commitment scan.

block_hint is the block from which the recipient should start scanning for the note’s commitment. The default implementation ignores it and delegates to NoteTransportClient::send_note, so existing implementors keep compiling. Transports that can carry the hint (e.g. the gRPC client) override this.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl NoteTransportClient for FaultyNoteTransportApi

Available on crate feature testing only.
Source§

impl NoteTransportClient for GrpcNoteTransportClient

Available on crate feature tonic only.
Source§

impl NoteTransportClient for MockNoteTransportApi

Available on crate feature testing only.