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 'life0: 'async_trait,
             Self: '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 'life0: 'async_trait,
             'life1: 'async_trait,
             Self: 'async_trait;
    fn stream_notes<'life0, 'async_trait>(
        &'life0 self,
        tag: NoteTag,
        cursor: NoteTransportCursor,
    ) -> Pin<Box<dyn Future<Output = Result<Box<dyn NoteStream<Item = Result<Vec<NoteInfo>, NoteTransportError>>>, NoteTransportError>> + Send + 'async_trait>>
       where 'life0: 'async_trait,
             Self: '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 'life0: 'async_trait,
             Self: '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 'life0: 'async_trait, Self: '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 'life0: 'async_trait, 'life1: 'async_trait, Self: '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<Item = Result<Vec<NoteInfo>, NoteTransportError>>>, NoteTransportError>> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: '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 'life0: 'async_trait, Self: '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§