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§
Sourcefn step(&mut self, buffer_set: &mut BufferSet) -> Result<Action>
fn step(&mut self, buffer_set: &mut BufferSet) -> Result<Action>
Process input and return the next action to perform.
The driver should:
- Call
step()to get the next action - Perform the action (read/write/tls handshake)
- Repeat until
Action::Finished
When Action::Write is returned, the driver should write
buffer_set.write_buffer to the socket.
Sourcefn transaction_status(&self) -> TransactionStatus
fn transaction_status(&self) -> TransactionStatus
Get the transaction status from the final ReadyForQuery.