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;
}
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

Implementors§