Trait RelayHost
pub trait RelayHost: Send + Sync {
// Required methods
fn cursor(&self) -> Cursor;
fn resume(&self, from: Cursor, limit: usize) -> Resumed;
fn ingest(
&self,
origin: &Origin,
entry: RelayedEntry,
) -> Result<u64, IngestError>;
}Expand description
What a host keeps for the kernel’s Relay (Kernel::with_relay):
its journal’s entries read from a cursor and taken in from another
process. The kernel answers asks and checks authorities and versions
itself; the host only reads and records.
Required Methods§
fn cursor(&self) -> Cursor
fn cursor(&self) -> Cursor
Where a reader that starts now stands (Relay::cursor).
fn resume(&self, from: Cursor, limit: usize) -> Resumed
fn resume(&self, from: Cursor, limit: usize) -> Resumed
The relayable entries after from, at most limit
(Relay::resume); the kernel writes each one’s point version.
fn ingest(
&self,
origin: &Origin,
entry: RelayedEntry,
) -> Result<u64, IngestError>
fn ingest( &self, origin: &Origin, entry: RelayedEntry, ) -> Result<u64, IngestError>
Records an entry relayed from origin and delivers it
(Relay::ingest), with the origin on its JournalEntry. The
kernel has already checked it with its authorities and refused a
point declared here not relayable, not an event, or at another
version; the host decodes it with its point’s codec
(Kernel::declaration) or keeps an unknown kind as text.