pub enum ConnectionState {
Initial,
AwaitingAuth,
Authenticating,
Idle,
QueryInProgress,
ReadingResults,
Closed,
}Expand description
Connection state
Variants§
Initial
Initial state (not connected)
AwaitingAuth
Startup sent, awaiting authentication request
Authenticating
Authentication in progress
Idle
Idle (ready for query)
QueryInProgress
Query in progress
ReadingResults
Reading query results
Closed
Closed
Implementations§
Source§impl ConnectionState
impl ConnectionState
Sourcepub const fn can_transition_to(&self, next: ConnectionState) -> bool
pub const fn can_transition_to(&self, next: ConnectionState) -> bool
Check if transition is valid
Sourcepub fn transition(&mut self, next: ConnectionState) -> Result<()>
pub fn transition(&mut self, next: ConnectionState) -> Result<()>
Transition to new state
§Errors
Returns Error::InvalidState if the transition from the current state to next is not allowed.
Trait Implementations§
Source§impl Clone for ConnectionState
impl Clone for ConnectionState
Source§fn clone(&self) -> ConnectionState
fn clone(&self) -> ConnectionState
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ConnectionState
impl Debug for ConnectionState
Source§impl Display for ConnectionState
impl Display for ConnectionState
Source§impl PartialEq for ConnectionState
impl PartialEq for ConnectionState
impl Copy for ConnectionState
impl Eq for ConnectionState
impl StructuralPartialEq for ConnectionState
Auto Trait Implementations§
impl Freeze for ConnectionState
impl RefUnwindSafe for ConnectionState
impl Send for ConnectionState
impl Sync for ConnectionState
impl Unpin for ConnectionState
impl UnsafeUnpin for ConnectionState
impl UnwindSafe for ConnectionState
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more