pub struct TypedSession<Transport, Phase, Cleanliness = ()> { /* private fields */ }Expand description
Transport-carrying typestate for this protocol role.
Implementations§
Source§impl<Transport, SourceCleanliness> TypedSession<Transport, Auth, SourceCleanliness>
impl<Transport, SourceCleanliness> TypedSession<Transport, Auth, SourceCleanliness>
Sourcepub fn project_internal_message(
self,
message: AuthInternalMessage,
) -> AuthInternalProjection<Transport, SourceCleanliness>
pub fn project_internal_message( self, message: AuthInternalMessage, ) -> AuthInternalProjection<Transport, SourceCleanliness>
Projects one AuthInternalMessage into its message-selected next connection.
Source§impl<Transport, SourceCleanliness> TypedSession<Transport, Auth, SourceCleanliness>
impl<Transport, SourceCleanliness> TypedSession<Transport, Auth, SourceCleanliness>
Sourcepub fn project_external_message(
self,
message: AuthExternalMessage,
) -> AuthExternalProjection<Transport, SourceCleanliness>
pub fn project_external_message( self, message: AuthExternalMessage, ) -> AuthExternalProjection<Transport, SourceCleanliness>
Projects one AuthExternalMessage into its message-selected next connection.
Source§impl<Transport, SourceCleanliness> TypedSession<Transport, PasswordResponse, SourceCleanliness>
impl<Transport, SourceCleanliness> TypedSession<Transport, PasswordResponse, SourceCleanliness>
Sourcepub fn project_internal_message(
self,
message: PasswordResponseInternalMessage,
) -> PasswordResponseInternalProjection<Transport, SourceCleanliness>
pub fn project_internal_message( self, message: PasswordResponseInternalMessage, ) -> PasswordResponseInternalProjection<Transport, SourceCleanliness>
Projects one PasswordResponseInternalMessage into its message-selected next connection.
Source§impl<Transport, SourceCleanliness> TypedSession<Transport, PasswordResponse, SourceCleanliness>
impl<Transport, SourceCleanliness> TypedSession<Transport, PasswordResponse, SourceCleanliness>
Sourcepub fn project_external_message(
self,
message: PasswordResponseExternalMessage,
) -> PasswordResponseExternalProjection<Transport, SourceCleanliness>
pub fn project_external_message( self, message: PasswordResponseExternalMessage, ) -> PasswordResponseExternalProjection<Transport, SourceCleanliness>
Projects one PasswordResponseExternalMessage into its message-selected next connection.
Source§impl<Transport, SourceCleanliness> TypedSession<Transport, TokenResponse, SourceCleanliness>
impl<Transport, SourceCleanliness> TypedSession<Transport, TokenResponse, SourceCleanliness>
Sourcepub fn project_internal_message(
self,
message: TokenResponseInternalMessage,
) -> TokenResponseInternalProjection<Transport, SourceCleanliness>
pub fn project_internal_message( self, message: TokenResponseInternalMessage, ) -> TokenResponseInternalProjection<Transport, SourceCleanliness>
Projects one TokenResponseInternalMessage into its message-selected next connection.
Source§impl<Transport, SourceCleanliness> TypedSession<Transport, TokenResponse, SourceCleanliness>
impl<Transport, SourceCleanliness> TypedSession<Transport, TokenResponse, SourceCleanliness>
Sourcepub fn project_external_message(
self,
message: TokenResponseExternalMessage,
) -> TokenResponseExternalProjection<Transport, SourceCleanliness>
pub fn project_external_message( self, message: TokenResponseExternalMessage, ) -> TokenResponseExternalProjection<Transport, SourceCleanliness>
Projects one TokenResponseExternalMessage into its message-selected next connection.
Source§impl<Transport, SourceCleanliness> TypedSession<Transport, TokenChallenge, SourceCleanliness>
impl<Transport, SourceCleanliness> TypedSession<Transport, TokenChallenge, SourceCleanliness>
Sourcepub fn project_internal_message(
self,
message: TokenChallengeInternalMessage,
) -> TokenChallengeInternalProjection<Transport, SourceCleanliness>
pub fn project_internal_message( self, message: TokenChallengeInternalMessage, ) -> TokenChallengeInternalProjection<Transport, SourceCleanliness>
Projects one TokenChallengeInternalMessage into its message-selected next connection.
Source§impl<Transport, SourceCleanliness> TypedSession<Transport, TokenChallenge, SourceCleanliness>
impl<Transport, SourceCleanliness> TypedSession<Transport, TokenChallenge, SourceCleanliness>
Sourcepub fn project_external_message(
self,
message: TokenChallengeExternalMessage,
) -> TokenChallengeExternalProjection<Transport, SourceCleanliness>
pub fn project_external_message( self, message: TokenChallengeExternalMessage, ) -> TokenChallengeExternalProjection<Transport, SourceCleanliness>
Projects one TokenChallengeExternalMessage into its message-selected next connection.
Source§impl<Transport, SourceCleanliness> TypedSession<Transport, SaslInitial, SourceCleanliness>
impl<Transport, SourceCleanliness> TypedSession<Transport, SaslInitial, SourceCleanliness>
Sourcepub fn project_internal_message(
self,
message: SaslInitialInternalMessage,
) -> SaslInitialInternalProjection<Transport, SourceCleanliness>
pub fn project_internal_message( self, message: SaslInitialInternalMessage, ) -> SaslInitialInternalProjection<Transport, SourceCleanliness>
Projects one SaslInitialInternalMessage into its message-selected next connection.
Source§impl<Transport, SourceCleanliness> TypedSession<Transport, SaslInitial, SourceCleanliness>
impl<Transport, SourceCleanliness> TypedSession<Transport, SaslInitial, SourceCleanliness>
Sourcepub fn project_external_message(
self,
message: SaslInitialExternalMessage,
) -> SaslInitialExternalProjection<Transport, SourceCleanliness>
pub fn project_external_message( self, message: SaslInitialExternalMessage, ) -> SaslInitialExternalProjection<Transport, SourceCleanliness>
Projects one SaslInitialExternalMessage into its message-selected next connection.
Source§impl<Transport, SourceCleanliness> TypedSession<Transport, Sasl, SourceCleanliness>
impl<Transport, SourceCleanliness> TypedSession<Transport, Sasl, SourceCleanliness>
Sourcepub fn project_internal_message(
self,
message: SaslInternalMessage,
) -> SaslInternalProjection<Transport, SourceCleanliness>
pub fn project_internal_message( self, message: SaslInternalMessage, ) -> SaslInternalProjection<Transport, SourceCleanliness>
Projects one SaslInternalMessage into its message-selected next connection.
Source§impl<Transport, SourceCleanliness> TypedSession<Transport, Sasl, SourceCleanliness>
impl<Transport, SourceCleanliness> TypedSession<Transport, Sasl, SourceCleanliness>
Sourcepub fn project_external_message(
self,
message: SaslExternalMessage,
) -> SaslExternalProjection<Transport, SourceCleanliness>
pub fn project_external_message( self, message: SaslExternalMessage, ) -> SaslExternalProjection<Transport, SourceCleanliness>
Projects one SaslExternalMessage into its message-selected next connection.
Source§impl<Transport, SourceCleanliness> TypedSession<Transport, SaslChallenge, SourceCleanliness>
impl<Transport, SourceCleanliness> TypedSession<Transport, SaslChallenge, SourceCleanliness>
Sourcepub fn project_internal_message(
self,
message: SaslChallengeInternalMessage,
) -> SaslChallengeInternalProjection<Transport, SourceCleanliness>
pub fn project_internal_message( self, message: SaslChallengeInternalMessage, ) -> SaslChallengeInternalProjection<Transport, SourceCleanliness>
Projects one SaslChallengeInternalMessage into its message-selected next connection.
Source§impl<Transport, SourceCleanliness> TypedSession<Transport, SaslChallenge, SourceCleanliness>
impl<Transport, SourceCleanliness> TypedSession<Transport, SaslChallenge, SourceCleanliness>
Sourcepub fn project_external_message(
self,
message: SaslChallengeExternalMessage,
) -> SaslChallengeExternalProjection<Transport, SourceCleanliness>
pub fn project_external_message( self, message: SaslChallengeExternalMessage, ) -> SaslChallengeExternalProjection<Transport, SourceCleanliness>
Projects one SaslChallengeExternalMessage into its message-selected next connection.
Source§impl<Transport, SourceCleanliness> TypedSession<Transport, SaslFinal, SourceCleanliness>
impl<Transport, SourceCleanliness> TypedSession<Transport, SaslFinal, SourceCleanliness>
Sourcepub fn project_internal_message(
self,
message: SaslFinalInternalMessage,
) -> SaslFinalInternalProjection<Transport, SourceCleanliness>
pub fn project_internal_message( self, message: SaslFinalInternalMessage, ) -> SaslFinalInternalProjection<Transport, SourceCleanliness>
Projects one SaslFinalInternalMessage into its message-selected next connection.
Source§impl<Transport, SourceCleanliness> TypedSession<Transport, SaslFinal, SourceCleanliness>
impl<Transport, SourceCleanliness> TypedSession<Transport, SaslFinal, SourceCleanliness>
Sourcepub fn project_external_message(
self,
message: SaslFinalExternalMessage,
) -> SaslFinalExternalProjection<Transport, SourceCleanliness>
pub fn project_external_message( self, message: SaslFinalExternalMessage, ) -> SaslFinalExternalProjection<Transport, SourceCleanliness>
Projects one SaslFinalExternalMessage into its message-selected next connection.
Source§impl<Transport, SourceCleanliness> TypedSession<Transport, AwaitingAuthOk, SourceCleanliness>
impl<Transport, SourceCleanliness> TypedSession<Transport, AwaitingAuthOk, SourceCleanliness>
Sourcepub fn project_internal_message(
self,
message: AwaitingAuthOkInternalMessage,
) -> AwaitingAuthOkInternalProjection<Transport, SourceCleanliness>
pub fn project_internal_message( self, message: AwaitingAuthOkInternalMessage, ) -> AwaitingAuthOkInternalProjection<Transport, SourceCleanliness>
Projects one AwaitingAuthOkInternalMessage into its message-selected next connection.
Source§impl<Transport, SourceCleanliness> TypedSession<Transport, AwaitingAuthOk, SourceCleanliness>
impl<Transport, SourceCleanliness> TypedSession<Transport, AwaitingAuthOk, SourceCleanliness>
Sourcepub fn project_external_message(
self,
message: AwaitingAuthOkExternalMessage,
) -> AwaitingAuthOkExternalProjection<Transport, SourceCleanliness>
pub fn project_external_message( self, message: AwaitingAuthOkExternalMessage, ) -> AwaitingAuthOkExternalProjection<Transport, SourceCleanliness>
Projects one AwaitingAuthOkExternalMessage into its message-selected next connection.
Source§impl<Transport, SourceCleanliness> TypedSession<Transport, AwaitingStartupReady, SourceCleanliness>
impl<Transport, SourceCleanliness> TypedSession<Transport, AwaitingStartupReady, SourceCleanliness>
Sourcepub fn project_internal_message(
self,
message: AwaitingStartupReadyInternalMessage,
) -> AwaitingStartupReadyInternalProjection<Transport, SourceCleanliness>
pub fn project_internal_message( self, message: AwaitingStartupReadyInternalMessage, ) -> AwaitingStartupReadyInternalProjection<Transport, SourceCleanliness>
Projects one AwaitingStartupReadyInternalMessage into its message-selected next connection.
Source§impl<Transport, SourceCleanliness> TypedSession<Transport, AwaitingStartupReady, SourceCleanliness>
impl<Transport, SourceCleanliness> TypedSession<Transport, AwaitingStartupReady, SourceCleanliness>
Sourcepub fn project_external_message(
self,
message: AwaitingStartupReadyExternalMessage,
) -> AwaitingStartupReadyExternalProjection<Transport, SourceCleanliness>
pub fn project_external_message( self, message: AwaitingStartupReadyExternalMessage, ) -> AwaitingStartupReadyExternalProjection<Transport, SourceCleanliness>
Projects one AwaitingStartupReadyExternalMessage into its message-selected next connection.
Source§impl<Transport, SourceCleanliness> TypedSession<Transport, Ready, SourceCleanliness>
impl<Transport, SourceCleanliness> TypedSession<Transport, Ready, SourceCleanliness>
Sourcepub fn project_internal_message(
self,
message: ReadyInternalMessage,
) -> ReadyInternalProjection<Transport, SourceCleanliness>
pub fn project_internal_message( self, message: ReadyInternalMessage, ) -> ReadyInternalProjection<Transport, SourceCleanliness>
Projects one ReadyInternalMessage into its message-selected next connection.
Source§impl<Transport, SourceCleanliness> TypedSession<Transport, Ready, SourceCleanliness>
impl<Transport, SourceCleanliness> TypedSession<Transport, Ready, SourceCleanliness>
Sourcepub fn project_external_message(
self,
message: ReadyExternalMessage,
) -> ReadyExternalProjection<Transport, SourceCleanliness>
pub fn project_external_message( self, message: ReadyExternalMessage, ) -> ReadyExternalProjection<Transport, SourceCleanliness>
Projects one ReadyExternalMessage into its message-selected next connection.
Source§impl<Transport, SourceCleanliness> TypedSession<Transport, Terminated, SourceCleanliness>
impl<Transport, SourceCleanliness> TypedSession<Transport, Terminated, SourceCleanliness>
Sourcepub fn project_internal_message(
self,
message: TerminatedInternalMessage,
) -> TerminatedInternalProjection<Transport, SourceCleanliness>
pub fn project_internal_message( self, message: TerminatedInternalMessage, ) -> TerminatedInternalProjection<Transport, SourceCleanliness>
Projects one TerminatedInternalMessage into its message-selected next connection.
Source§impl<Transport, SourceCleanliness> TypedSession<Transport, Terminated, SourceCleanliness>
impl<Transport, SourceCleanliness> TypedSession<Transport, Terminated, SourceCleanliness>
Sourcepub fn project_external_message(
self,
message: TerminatedExternalMessage,
) -> TerminatedExternalProjection<Transport, SourceCleanliness>
pub fn project_external_message( self, message: TerminatedExternalMessage, ) -> TerminatedExternalProjection<Transport, SourceCleanliness>
Projects one TerminatedExternalMessage into its message-selected next connection.
Source§impl<Transport, Cleanliness> TypedSession<Transport, Auth, Cleanliness>
impl<Transport, Cleanliness> TypedSession<Transport, Auth, Cleanliness>
Sourcepub const fn with_transport(transport: Transport) -> Self
pub const fn with_transport(transport: Transport) -> Self
Attaches transport to a session in the initial phase.
Source§impl<Transport, Phase, Cleanliness> TypedSession<Transport, Phase, Cleanliness>
impl<Transport, Phase, Cleanliness> TypedSession<Transport, Phase, Cleanliness>
Sourcepub fn map_transport<Next>(
self,
map: impl FnOnce(Transport) -> Next,
) -> TypedSession<Next, Phase, Cleanliness>
pub fn map_transport<Next>( self, map: impl FnOnce(Transport) -> Next, ) -> TypedSession<Next, Phase, Cleanliness>
Replaces the transport representation without changing protocol indices.
Sourcepub fn into_transport(self) -> Transport
pub fn into_transport(self) -> Transport
Deliberately leaves the generated typestate API and returns its transport.
Source§impl<Transport, Cleanliness> TypedSession<Transport, Auth, Cleanliness>
impl<Transport, Cleanliness> TypedSession<Transport, Auth, Cleanliness>
Sourcepub fn negotiate<Output, Error>(
self,
payload: NegotiateProtocolVersion,
handle: impl FnOnce(&mut Transport, NegotiateProtocolVersion) -> Result<Output, Error>,
) -> Result<(TypedSession<Transport, Auth, Cleanliness>, Output), (Self, Error)>
pub fn negotiate<Output, Error>( self, payload: NegotiateProtocolVersion, handle: impl FnOnce(&mut Transport, NegotiateProtocolVersion) -> Result<Output, Error>, ) -> Result<(TypedSession<Transport, Auth, Cleanliness>, Output), (Self, Error)>
Handles the payload for negotiate; success enters Auth and failure returns the unchanged session.
Sourcepub fn ok(self) -> TypedSession<Transport, AwaitingStartupReady, Cleanliness>
pub fn ok(self) -> TypedSession<Transport, AwaitingStartupReady, Cleanliness>
Applies ok and enters AwaitingStartupReady.
Sourcepub fn cleartext(self) -> TypedSession<Transport, PasswordResponse, Cleanliness>
pub fn cleartext(self) -> TypedSession<Transport, PasswordResponse, Cleanliness>
Applies cleartext and enters PasswordResponse.
Sourcepub fn md5<Output, Error>(
self,
payload: [u8; 4],
handle: impl FnOnce(&mut Transport, [u8; 4]) -> Result<Output, Error>,
) -> Result<(TypedSession<Transport, PasswordResponse, Cleanliness>, Output), (Self, Error)>
pub fn md5<Output, Error>( self, payload: [u8; 4], handle: impl FnOnce(&mut Transport, [u8; 4]) -> Result<Output, Error>, ) -> Result<(TypedSession<Transport, PasswordResponse, Cleanliness>, Output), (Self, Error)>
Handles the payload for md5; success enters PasswordResponse and failure returns the unchanged session.
Sourcepub fn sasl<Output, Error>(
self,
payload: Vec<Bytes>,
handle: impl FnOnce(&mut Transport, Vec<Bytes>) -> Result<Output, Error>,
) -> Result<(TypedSession<Transport, SaslInitial, Cleanliness>, Output), (Self, Error)>
pub fn sasl<Output, Error>( self, payload: Vec<Bytes>, handle: impl FnOnce(&mut Transport, Vec<Bytes>) -> Result<Output, Error>, ) -> Result<(TypedSession<Transport, SaslInitial, Cleanliness>, Output), (Self, Error)>
Handles the payload for sasl; success enters SaslInitial and failure returns the unchanged session.
Sourcepub fn gss(self) -> TypedSession<Transport, TokenResponse, Cleanliness>
pub fn gss(self) -> TypedSession<Transport, TokenResponse, Cleanliness>
Applies gss and enters TokenResponse.
Sourcepub fn sspi(self) -> TypedSession<Transport, TokenResponse, Cleanliness>
pub fn sspi(self) -> TypedSession<Transport, TokenResponse, Cleanliness>
Applies sspi and enters TokenResponse.
Sourcepub fn kerberos_v5(self) -> TypedSession<Transport, TokenResponse, Cleanliness>
pub fn kerberos_v5(self) -> TypedSession<Transport, TokenResponse, Cleanliness>
Applies kerberos_v5 and enters TokenResponse.
Sourcepub fn error<Output, Error>(
self,
payload: DiagnosticResponse,
handle: impl FnOnce(&mut Transport, DiagnosticResponse) -> Result<Output, Error>,
) -> Result<(TypedSession<Transport, Terminated, Cleanliness>, Output), (Self, Error)>
pub fn error<Output, Error>( self, payload: DiagnosticResponse, handle: impl FnOnce(&mut Transport, DiagnosticResponse) -> Result<Output, Error>, ) -> Result<(TypedSession<Transport, Terminated, Cleanliness>, Output), (Self, Error)>
Handles the payload for error; success enters Terminated and failure returns the unchanged session.
Source§impl<Transport, Cleanliness> TypedSession<Transport, PasswordResponse, Cleanliness>
impl<Transport, Cleanliness> TypedSession<Transport, PasswordResponse, Cleanliness>
Sourcepub fn password<Output, Error>(
self,
payload: Bytes,
handle: impl FnOnce(&mut Transport, Bytes) -> Result<Output, Error>,
) -> Result<(TypedSession<Transport, AwaitingAuthOk, Cleanliness>, Output), (Self, Error)>
pub fn password<Output, Error>( self, payload: Bytes, handle: impl FnOnce(&mut Transport, Bytes) -> Result<Output, Error>, ) -> Result<(TypedSession<Transport, AwaitingAuthOk, Cleanliness>, Output), (Self, Error)>
Handles the payload for password; success enters AwaitingAuthOk and failure returns the unchanged session.
Source§impl<Transport, Cleanliness> TypedSession<Transport, TokenResponse, Cleanliness>
impl<Transport, Cleanliness> TypedSession<Transport, TokenResponse, Cleanliness>
Sourcepub fn response<Output, Error>(
self,
payload: Bytes,
handle: impl FnOnce(&mut Transport, Bytes) -> Result<Output, Error>,
) -> Result<(TypedSession<Transport, TokenChallenge, Cleanliness>, Output), (Self, Error)>
pub fn response<Output, Error>( self, payload: Bytes, handle: impl FnOnce(&mut Transport, Bytes) -> Result<Output, Error>, ) -> Result<(TypedSession<Transport, TokenChallenge, Cleanliness>, Output), (Self, Error)>
Handles the payload for response; success enters TokenChallenge and failure returns the unchanged session.
Source§impl<Transport, Cleanliness> TypedSession<Transport, TokenChallenge, Cleanliness>
impl<Transport, Cleanliness> TypedSession<Transport, TokenChallenge, Cleanliness>
Sourcepub fn continue_token<Output, Error>(
self,
payload: Bytes,
handle: impl FnOnce(&mut Transport, Bytes) -> Result<Output, Error>,
) -> Result<(TypedSession<Transport, TokenResponse, Cleanliness>, Output), (Self, Error)>
pub fn continue_token<Output, Error>( self, payload: Bytes, handle: impl FnOnce(&mut Transport, Bytes) -> Result<Output, Error>, ) -> Result<(TypedSession<Transport, TokenResponse, Cleanliness>, Output), (Self, Error)>
Handles the payload for continue_token; success enters TokenResponse and failure returns the unchanged session.
Sourcepub fn ok(self) -> TypedSession<Transport, AwaitingStartupReady, Cleanliness>
pub fn ok(self) -> TypedSession<Transport, AwaitingStartupReady, Cleanliness>
Applies ok and enters AwaitingStartupReady.
Sourcepub fn error<Output, Error>(
self,
payload: DiagnosticResponse,
handle: impl FnOnce(&mut Transport, DiagnosticResponse) -> Result<Output, Error>,
) -> Result<(TypedSession<Transport, Terminated, Cleanliness>, Output), (Self, Error)>
pub fn error<Output, Error>( self, payload: DiagnosticResponse, handle: impl FnOnce(&mut Transport, DiagnosticResponse) -> Result<Output, Error>, ) -> Result<(TypedSession<Transport, Terminated, Cleanliness>, Output), (Self, Error)>
Handles the payload for error; success enters Terminated and failure returns the unchanged session.
Source§impl<Transport, Cleanliness> TypedSession<Transport, SaslInitial, Cleanliness>
impl<Transport, Cleanliness> TypedSession<Transport, SaslInitial, Cleanliness>
Sourcepub fn initial<Output, Error>(
self,
payload: SaslInitialResponse,
handle: impl FnOnce(&mut Transport, SaslInitialResponse) -> Result<Output, Error>,
) -> Result<(TypedSession<Transport, Sasl, Cleanliness>, Output), (Self, Error)>
pub fn initial<Output, Error>( self, payload: SaslInitialResponse, handle: impl FnOnce(&mut Transport, SaslInitialResponse) -> Result<Output, Error>, ) -> Result<(TypedSession<Transport, Sasl, Cleanliness>, Output), (Self, Error)>
Handles the payload for initial; success enters Sasl and failure returns the unchanged session.
Source§impl<Transport, Cleanliness> TypedSession<Transport, Sasl, Cleanliness>
impl<Transport, Cleanliness> TypedSession<Transport, Sasl, Cleanliness>
Sourcepub fn continue_response<Output, Error>(
self,
payload: Bytes,
handle: impl FnOnce(&mut Transport, Bytes) -> Result<Output, Error>,
) -> Result<(TypedSession<Transport, SaslChallenge, Cleanliness>, Output), (Self, Error)>
pub fn continue_response<Output, Error>( self, payload: Bytes, handle: impl FnOnce(&mut Transport, Bytes) -> Result<Output, Error>, ) -> Result<(TypedSession<Transport, SaslChallenge, Cleanliness>, Output), (Self, Error)>
Handles the payload for continue_response; success enters SaslChallenge and failure returns the unchanged session.
Sourcepub fn final_response<Output, Error>(
self,
payload: Bytes,
handle: impl FnOnce(&mut Transport, Bytes) -> Result<Output, Error>,
) -> Result<(TypedSession<Transport, SaslFinal, Cleanliness>, Output), (Self, Error)>
pub fn final_response<Output, Error>( self, payload: Bytes, handle: impl FnOnce(&mut Transport, Bytes) -> Result<Output, Error>, ) -> Result<(TypedSession<Transport, SaslFinal, Cleanliness>, Output), (Self, Error)>
Handles the payload for final_response; success enters SaslFinal and failure returns the unchanged session.
Sourcepub fn error<Output, Error>(
self,
payload: DiagnosticResponse,
handle: impl FnOnce(&mut Transport, DiagnosticResponse) -> Result<Output, Error>,
) -> Result<(TypedSession<Transport, Terminated, Cleanliness>, Output), (Self, Error)>
pub fn error<Output, Error>( self, payload: DiagnosticResponse, handle: impl FnOnce(&mut Transport, DiagnosticResponse) -> Result<Output, Error>, ) -> Result<(TypedSession<Transport, Terminated, Cleanliness>, Output), (Self, Error)>
Handles the payload for error; success enters Terminated and failure returns the unchanged session.
Source§impl<Transport, Cleanliness> TypedSession<Transport, SaslChallenge, Cleanliness>
impl<Transport, Cleanliness> TypedSession<Transport, SaslChallenge, Cleanliness>
Sourcepub fn response<Output, Error>(
self,
payload: Bytes,
handle: impl FnOnce(&mut Transport, Bytes) -> Result<Output, Error>,
) -> Result<(TypedSession<Transport, Sasl, Cleanliness>, Output), (Self, Error)>
pub fn response<Output, Error>( self, payload: Bytes, handle: impl FnOnce(&mut Transport, Bytes) -> Result<Output, Error>, ) -> Result<(TypedSession<Transport, Sasl, Cleanliness>, Output), (Self, Error)>
Handles the payload for response; success enters Sasl and failure returns the unchanged session.
Source§impl<Transport, Cleanliness> TypedSession<Transport, SaslFinal, Cleanliness>
impl<Transport, Cleanliness> TypedSession<Transport, SaslFinal, Cleanliness>
Sourcepub fn verified(self) -> TypedSession<Transport, AwaitingAuthOk, Cleanliness>
pub fn verified(self) -> TypedSession<Transport, AwaitingAuthOk, Cleanliness>
Applies verified and enters AwaitingAuthOk.
Source§impl<Transport, Cleanliness> TypedSession<Transport, AwaitingAuthOk, Cleanliness>
impl<Transport, Cleanliness> TypedSession<Transport, AwaitingAuthOk, Cleanliness>
Sourcepub fn ok(self) -> TypedSession<Transport, AwaitingStartupReady, Cleanliness>
pub fn ok(self) -> TypedSession<Transport, AwaitingStartupReady, Cleanliness>
Applies ok and enters AwaitingStartupReady.
Sourcepub fn error<Output, Error>(
self,
payload: DiagnosticResponse,
handle: impl FnOnce(&mut Transport, DiagnosticResponse) -> Result<Output, Error>,
) -> Result<(TypedSession<Transport, Terminated, Cleanliness>, Output), (Self, Error)>
pub fn error<Output, Error>( self, payload: DiagnosticResponse, handle: impl FnOnce(&mut Transport, DiagnosticResponse) -> Result<Output, Error>, ) -> Result<(TypedSession<Transport, Terminated, Cleanliness>, Output), (Self, Error)>
Handles the payload for error; success enters Terminated and failure returns the unchanged session.
Source§impl<Transport, Cleanliness> TypedSession<Transport, AwaitingStartupReady, Cleanliness>
impl<Transport, Cleanliness> TypedSession<Transport, AwaitingStartupReady, Cleanliness>
Sourcepub fn ready<Output, Error>(
self,
payload: TransactionStatus,
handle: impl FnOnce(&mut Transport, TransactionStatus) -> Result<Output, Error>,
) -> Result<(TypedSession<Transport, Ready, Cleanliness>, Output), (Self, Error)>
pub fn ready<Output, Error>( self, payload: TransactionStatus, handle: impl FnOnce(&mut Transport, TransactionStatus) -> Result<Output, Error>, ) -> Result<(TypedSession<Transport, Ready, Cleanliness>, Output), (Self, Error)>
Handles the payload for ready; success enters Ready and failure returns the unchanged session.