[][src]Trait paxakos::LogEntry

pub trait LogEntry: 'static + Clone + Debug + Send + Sync + Unpin {
    type Id: Identifier;
    type Reader: Read;
#[must_use]    fn from_reader<'async_trait, R: AsyncRead + Unpin>(
        read: R
    ) -> Pin<Box<dyn Future<Output = Result<Self, BoxError>> + 'async_trait>>
    where
        R: 'async_trait,
        Self: 'async_trait
;
fn size(&self) -> usize;
fn to_reader(&self) -> Self::Reader;
fn id(&self) -> Self::Id; }

Appended to the shared log and applied to the shared State.

Associated Types

Loading content...

Required methods

#[must_use]fn from_reader<'async_trait, R: AsyncRead + Unpin>(
    read: R
) -> Pin<Box<dyn Future<Output = Result<Self, BoxError>> + 'async_trait>> where
    R: 'async_trait,
    Self: 'async_trait, 

Deserializes log entry that was previously serialized using to_reader().

While implementations need not detect arbitrary data corruption, they must not panic.

fn size(&self) -> usize

Number of bytes the result of to_reader() will emit.

fn to_reader(&self) -> Self::Reader

Serializes the log entry to enable snapshots.

LogEntry::from_reader(e.to_reader()) must yield an equivalent log entry.

fn id(&self) -> Self::Id

Returns a unique identifier for the log entry.

Identifiers need only be unique within the rough timeframe of them being appended to the distributed log. That notwithstanding it is recommended that UUIDs or some other "universally unique" identifier are used.

Loading content...

Implementors

Loading content...