Struct raft_engine::LogBatch[][src]

pub struct LogBatch<E, W> where
    E: Message,
    W: EntryExt<E>, 
{ pub items: Vec<LogItem<E>>, // some fields omitted }

Fields

items: Vec<LogItem<E>>

Implementations

impl<E, W> LogBatch<E, W> where
    E: Message,
    W: EntryExt<E>, 
[src]

pub fn with_capacity(cap: usize) -> Self[src]

pub fn add_entries(&mut self, region_id: u64, entries: Vec<E>)[src]

pub fn clean_region(&mut self, region_id: u64)[src]

pub fn add_command(&mut self, region_id: u64, cmd: Command)[src]

pub fn delete(&mut self, region_id: u64, key: Vec<u8>)[src]

pub fn put(&mut self, region_id: u64, key: Vec<u8>, value: Vec<u8>)[src]

pub fn put_msg<M: Message>(
    &mut self,
    region_id: u64,
    key: Vec<u8>,
    m: &M
) -> Result<()>
[src]

pub fn is_empty(&self) -> bool[src]

pub fn from_bytes(
    buf: &mut &'_ [u8],
    file_num: u64,
    base_offset: u64
) -> Result<Option<LogBatch<E, W>>>
[src]

pub fn encode_to_bytes(
    &mut self,
    compression_threshold: usize
) -> Option<Vec<u8>>
[src]

pub fn entries_size(&self) -> usize[src]

Trait Implementations

impl<E: Debug, W: Debug> Debug for LogBatch<E, W> where
    E: Message,
    W: EntryExt<E>, 
[src]

impl<E, W> Default for LogBatch<E, W> where
    E: Message,
    W: EntryExt<E>, 
[src]

impl<E: PartialEq, W: PartialEq> PartialEq<LogBatch<E, W>> for LogBatch<E, W> where
    E: Message,
    W: EntryExt<E>, 
[src]

impl<E, W> StructuralPartialEq for LogBatch<E, W> where
    E: Message,
    W: EntryExt<E>, 
[src]

Auto Trait Implementations

impl<E, W> RefUnwindSafe for LogBatch<E, W> where
    E: RefUnwindSafe,
    W: RefUnwindSafe

impl<E, W> Send for LogBatch<E, W>

impl<E, W> Sync for LogBatch<E, W>

impl<E, W> Unpin for LogBatch<E, W> where
    E: Unpin,
    W: Unpin

impl<E, W> UnwindSafe for LogBatch<E, W> where
    E: UnwindSafe,
    W: UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Pointable for T[src]

type Init = T

The type for initializers.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.