Trait tikv::server::raft_client::Buffer[][src]

trait Buffer {
    type OutputMessage;
    fn full(&self) -> bool;
fn push(&mut self, msg: RaftMessage);
fn empty(&self) -> bool;
fn flush(
        &mut self,
        sender: &mut ClientCStreamSender<Self::OutputMessage>
    ) -> Result<()>; }

Associated Types

type OutputMessage[src]

Loading content...

Required methods

fn full(&self) -> bool[src]

Tests if it is full.

A full buffer should be flushed successfully before calling push.

fn push(&mut self, msg: RaftMessage)[src]

Pushes the message into buffer.

fn empty(&self) -> bool[src]

Checks if the batch is empty.

fn flush(
    &mut self,
    sender: &mut ClientCStreamSender<Self::OutputMessage>
) -> Result<()>
[src]

Flushes the message to grpc.

sender should be able to accept messages.

Loading content...

Implementors

impl Buffer for BatchMessageBuffer[src]

type OutputMessage = BatchRaftMessage

impl Buffer for MessageBuffer[src]

type OutputMessage = RaftMessage

Loading content...