pub struct TypedSession<Transport, Phase, Cleanliness = ()> { /* private fields */ }Expand description
Transport-carrying typestate for this protocol role.
Implementations§
Source§impl<Transport, SourceCleanliness> TypedSession<Transport, PreStartup, SourceCleanliness>
impl<Transport, SourceCleanliness> TypedSession<Transport, PreStartup, SourceCleanliness>
Sourcepub fn project_internal_message(
self,
message: PreStartupInternalMessage,
) -> PreStartupInternalProjection<Transport, SourceCleanliness>
pub fn project_internal_message( self, message: PreStartupInternalMessage, ) -> PreStartupInternalProjection<Transport, SourceCleanliness>
Projects one PreStartupInternalMessage into its message-selected next connection.
Source§impl<Transport, SourceCleanliness> TypedSession<Transport, PreStartup, SourceCleanliness>
impl<Transport, SourceCleanliness> TypedSession<Transport, PreStartup, SourceCleanliness>
Sourcepub fn project_external_message(
self,
message: PreStartupExternalMessage,
) -> PreStartupExternalProjection<Transport, SourceCleanliness>
pub fn project_external_message( self, message: PreStartupExternalMessage, ) -> PreStartupExternalProjection<Transport, SourceCleanliness>
Projects one PreStartupExternalMessage into its message-selected next connection.
Source§impl<Transport, SourceCleanliness> TypedSession<Transport, AwaitingSslReply, SourceCleanliness>
impl<Transport, SourceCleanliness> TypedSession<Transport, AwaitingSslReply, SourceCleanliness>
Sourcepub fn project_internal_message(
self,
message: AwaitingSslReplyInternalMessage,
) -> AwaitingSslReplyInternalProjection<Transport, SourceCleanliness>
pub fn project_internal_message( self, message: AwaitingSslReplyInternalMessage, ) -> AwaitingSslReplyInternalProjection<Transport, SourceCleanliness>
Projects one AwaitingSslReplyInternalMessage into its message-selected next connection.
Source§impl<Transport, SourceCleanliness> TypedSession<Transport, AwaitingSslReply, SourceCleanliness>
impl<Transport, SourceCleanliness> TypedSession<Transport, AwaitingSslReply, SourceCleanliness>
Sourcepub fn project_external_message(
self,
message: AwaitingSslReplyExternalMessage,
) -> AwaitingSslReplyExternalProjection<Transport, SourceCleanliness>
pub fn project_external_message( self, message: AwaitingSslReplyExternalMessage, ) -> AwaitingSslReplyExternalProjection<Transport, SourceCleanliness>
Projects one AwaitingSslReplyExternalMessage into its message-selected next connection.
Source§impl<Transport, SourceCleanliness> TypedSession<Transport, AwaitingGssReply, SourceCleanliness>
impl<Transport, SourceCleanliness> TypedSession<Transport, AwaitingGssReply, SourceCleanliness>
Sourcepub fn project_internal_message(
self,
message: AwaitingGssReplyInternalMessage,
) -> AwaitingGssReplyInternalProjection<Transport, SourceCleanliness>
pub fn project_internal_message( self, message: AwaitingGssReplyInternalMessage, ) -> AwaitingGssReplyInternalProjection<Transport, SourceCleanliness>
Projects one AwaitingGssReplyInternalMessage into its message-selected next connection.
Source§impl<Transport, SourceCleanliness> TypedSession<Transport, AwaitingGssReply, SourceCleanliness>
impl<Transport, SourceCleanliness> TypedSession<Transport, AwaitingGssReply, SourceCleanliness>
Sourcepub fn project_external_message(
self,
message: AwaitingGssReplyExternalMessage,
) -> AwaitingGssReplyExternalProjection<Transport, SourceCleanliness>
pub fn project_external_message( self, message: AwaitingGssReplyExternalMessage, ) -> AwaitingGssReplyExternalProjection<Transport, SourceCleanliness>
Projects one AwaitingGssReplyExternalMessage into its message-selected next connection.
Source§impl<Transport, SourceCleanliness> TypedSession<Transport, TlsHandshake, SourceCleanliness>
impl<Transport, SourceCleanliness> TypedSession<Transport, TlsHandshake, SourceCleanliness>
Sourcepub fn project_internal_message(
self,
message: TlsHandshakeInternalMessage,
) -> TlsHandshakeInternalProjection<Transport, SourceCleanliness>
pub fn project_internal_message( self, message: TlsHandshakeInternalMessage, ) -> TlsHandshakeInternalProjection<Transport, SourceCleanliness>
Projects one TlsHandshakeInternalMessage into its message-selected next connection.
Source§impl<Transport, SourceCleanliness> TypedSession<Transport, TlsHandshake, SourceCleanliness>
impl<Transport, SourceCleanliness> TypedSession<Transport, TlsHandshake, SourceCleanliness>
Sourcepub fn project_external_message(
self,
message: TlsHandshakeExternalMessage,
) -> TlsHandshakeExternalProjection<Transport, SourceCleanliness>
pub fn project_external_message( self, message: TlsHandshakeExternalMessage, ) -> TlsHandshakeExternalProjection<Transport, SourceCleanliness>
Projects one TlsHandshakeExternalMessage into its message-selected next connection.
Source§impl<Transport, SourceCleanliness> TypedSession<Transport, GssHandshake, SourceCleanliness>
impl<Transport, SourceCleanliness> TypedSession<Transport, GssHandshake, SourceCleanliness>
Sourcepub fn project_internal_message(
self,
message: GssHandshakeInternalMessage,
) -> GssHandshakeInternalProjection<Transport, SourceCleanliness>
pub fn project_internal_message( self, message: GssHandshakeInternalMessage, ) -> GssHandshakeInternalProjection<Transport, SourceCleanliness>
Projects one GssHandshakeInternalMessage into its message-selected next connection.
Source§impl<Transport, SourceCleanliness> TypedSession<Transport, GssHandshake, SourceCleanliness>
impl<Transport, SourceCleanliness> TypedSession<Transport, GssHandshake, SourceCleanliness>
Sourcepub fn project_external_message(
self,
message: GssHandshakeExternalMessage,
) -> GssHandshakeExternalProjection<Transport, SourceCleanliness>
pub fn project_external_message( self, message: GssHandshakeExternalMessage, ) -> GssHandshakeExternalProjection<Transport, SourceCleanliness>
Projects one GssHandshakeExternalMessage into its message-selected next connection.
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, 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, PreStartup, Cleanliness>
impl<Transport, Cleanliness> TypedSession<Transport, PreStartup, 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, PreStartup, Cleanliness>
impl<Transport, Cleanliness> TypedSession<Transport, PreStartup, Cleanliness>
Sourcepub fn ssl_request(
self,
) -> TypedSession<Transport, AwaitingSslReply, Cleanliness>
pub fn ssl_request( self, ) -> TypedSession<Transport, AwaitingSslReply, Cleanliness>
Applies ssl_request and enters AwaitingSslReply.
Sourcepub fn gss_request(
self,
) -> TypedSession<Transport, AwaitingGssReply, Cleanliness>
pub fn gss_request( self, ) -> TypedSession<Transport, AwaitingGssReply, Cleanliness>
Applies gss_request and enters AwaitingGssReply.
Sourcepub fn cancel<Output, Error>(
self,
payload: (u32, Bytes),
handle: impl FnOnce(&mut Transport, (u32, Bytes)) -> Result<Output, Error>,
) -> Result<(TypedSession<Transport, Terminated, Cleanliness>, Output), (Self, Error)>
pub fn cancel<Output, Error>( self, payload: (u32, Bytes), handle: impl FnOnce(&mut Transport, (u32, Bytes)) -> Result<Output, Error>, ) -> Result<(TypedSession<Transport, Terminated, Cleanliness>, Output), (Self, Error)>
Handles the payload for cancel; success enters Terminated and failure returns the unchanged session.
Sourcepub fn startup<Output, Error>(
self,
payload: StartupMessage,
handle: impl FnOnce(&mut Transport, StartupMessage) -> Result<Output, Error>,
) -> Result<(TypedSession<Transport, Auth, Cleanliness>, Output), (Self, Error)>
pub fn startup<Output, Error>( self, payload: StartupMessage, handle: impl FnOnce(&mut Transport, StartupMessage) -> Result<Output, Error>, ) -> Result<(TypedSession<Transport, Auth, Cleanliness>, Output), (Self, Error)>
Handles the payload for startup; success enters Auth and failure returns the unchanged session.
Source§impl<Transport, Cleanliness> TypedSession<Transport, AwaitingSslReply, Cleanliness>
impl<Transport, Cleanliness> TypedSession<Transport, AwaitingSslReply, Cleanliness>
Sourcepub fn accept(self) -> TypedSession<Transport, TlsHandshake, Cleanliness>
pub fn accept(self) -> TypedSession<Transport, TlsHandshake, Cleanliness>
Applies accept and enters TlsHandshake.
Sourcepub fn reject(self) -> TypedSession<Transport, PreStartup, Cleanliness>
pub fn reject(self) -> TypedSession<Transport, PreStartup, Cleanliness>
Applies reject and enters PreStartup.
Sourcepub fn legacy_error(self) -> TypedSession<Transport, Terminated, Cleanliness>
pub fn legacy_error(self) -> TypedSession<Transport, Terminated, Cleanliness>
Applies legacy_error and enters Terminated.
Source§impl<Transport, Cleanliness> TypedSession<Transport, AwaitingGssReply, Cleanliness>
impl<Transport, Cleanliness> TypedSession<Transport, AwaitingGssReply, Cleanliness>
Sourcepub fn accept(self) -> TypedSession<Transport, GssHandshake, Cleanliness>
pub fn accept(self) -> TypedSession<Transport, GssHandshake, Cleanliness>
Applies accept and enters GssHandshake.
Sourcepub fn reject(self) -> TypedSession<Transport, PreStartup, Cleanliness>
pub fn reject(self) -> TypedSession<Transport, PreStartup, Cleanliness>
Applies reject and enters PreStartup.
Sourcepub fn legacy_error(self) -> TypedSession<Transport, Terminated, Cleanliness>
pub fn legacy_error(self) -> TypedSession<Transport, Terminated, Cleanliness>
Applies legacy_error and enters Terminated.
Source§impl<Transport, Cleanliness> TypedSession<Transport, TlsHandshake, Cleanliness>
impl<Transport, Cleanliness> TypedSession<Transport, TlsHandshake, Cleanliness>
Sourcepub fn complete(self) -> TypedSession<Transport, PreStartup, Cleanliness>
pub fn complete(self) -> TypedSession<Transport, PreStartup, Cleanliness>
Applies complete and enters PreStartup.
Source§impl<Transport, Cleanliness> TypedSession<Transport, GssHandshake, Cleanliness>
impl<Transport, Cleanliness> TypedSession<Transport, GssHandshake, Cleanliness>
Sourcepub fn complete(self) -> TypedSession<Transport, PreStartup, Cleanliness>
pub fn complete(self) -> TypedSession<Transport, PreStartup, Cleanliness>
Applies complete and enters PreStartup.