StateMachine

Trait StateMachine 

Source
pub trait StateMachine {
    // Required methods
    fn step(&mut self, buffer_set: &mut BufferSet) -> Result<Action>;
    fn transaction_status(&self) -> TransactionStatus;
}
Expand description

Trait for state machines that can be driven by a connection.

Required Methods§

Source

fn step(&mut self, buffer_set: &mut BufferSet) -> Result<Action>

Process input and return the next action to perform.

The driver should:

  1. Call step() to get the next action
  2. Perform the action (read/write/tls handshake)
  3. Repeat until Action::Finished

When Action::Write is returned, the driver should write buffer_set.write_buffer to the socket.

Source

fn transaction_status(&self) -> TransactionStatus

Get the transaction status from the final ReadyForQuery.

Implementors§