pub struct DualTypedSession<Transport, Phase, Cleanliness = ()> { /* private fields */ }Expand description
Transport-carrying typestate for the peer role.
Implementations§
Source§impl<Transport, Cleanliness> DualTypedSession<Transport, PreStartup, Cleanliness>
impl<Transport, Cleanliness> DualTypedSession<Transport, PreStartup, Cleanliness>
Sourcepub const fn with_transport(transport: Transport) -> Self
pub const fn with_transport(transport: Transport) -> Self
Attaches transport to a dual session in the initial phase.
Source§impl<Transport, Phase, Cleanliness> DualTypedSession<Transport, Phase, Cleanliness>
impl<Transport, Phase, Cleanliness> DualTypedSession<Transport, Phase, Cleanliness>
Sourcepub fn map_transport<Next>(
self,
map: impl FnOnce(Transport) -> Next,
) -> DualTypedSession<Next, Phase, Cleanliness>
pub fn map_transport<Next>( self, map: impl FnOnce(Transport) -> Next, ) -> DualTypedSession<Next, Phase, Cleanliness>
Replaces the dual transport representation without changing protocol indices.
Sourcepub fn into_transport(self) -> Transport
pub fn into_transport(self) -> Transport
Deliberately leaves the generated dual API and returns its transport.
Source§impl<Transport, Cleanliness> DualTypedSession<Transport, PreStartup, Cleanliness>
impl<Transport, Cleanliness> DualTypedSession<Transport, PreStartup, Cleanliness>
Sourcepub fn ssl_request(
self,
) -> DualTypedSession<Transport, AwaitingSslReply, Cleanliness>
pub fn ssl_request( self, ) -> DualTypedSession<Transport, AwaitingSslReply, Cleanliness>
Applies the dual ssl_request transition and enters AwaitingSslReply.
Sourcepub fn gss_request(
self,
) -> DualTypedSession<Transport, AwaitingGssReply, Cleanliness>
pub fn gss_request( self, ) -> DualTypedSession<Transport, AwaitingGssReply, Cleanliness>
Applies the dual gss_request transition and enters AwaitingGssReply.
Sourcepub fn cancel<Output, Error>(
self,
payload: (u32, Bytes),
handle: impl FnOnce(&mut Transport, (u32, Bytes)) -> Result<Output, Error>,
) -> Result<(DualTypedSession<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<(DualTypedSession<Transport, Terminated, Cleanliness>, Output), (Self, Error)>
Handles the dual 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<(DualTypedSession<Transport, Auth, Cleanliness>, Output), (Self, Error)>
pub fn startup<Output, Error>( self, payload: StartupMessage, handle: impl FnOnce(&mut Transport, StartupMessage) -> Result<Output, Error>, ) -> Result<(DualTypedSession<Transport, Auth, Cleanliness>, Output), (Self, Error)>
Handles the dual payload for startup; success enters Auth and failure returns the unchanged session.
Source§impl<Transport, Cleanliness> DualTypedSession<Transport, AwaitingSslReply, Cleanliness>
impl<Transport, Cleanliness> DualTypedSession<Transport, AwaitingSslReply, Cleanliness>
Sourcepub fn accept(self) -> DualTypedSession<Transport, TlsHandshake, Cleanliness>
pub fn accept(self) -> DualTypedSession<Transport, TlsHandshake, Cleanliness>
Applies the dual accept transition and enters TlsHandshake.
Sourcepub fn reject(self) -> DualTypedSession<Transport, PreStartup, Cleanliness>
pub fn reject(self) -> DualTypedSession<Transport, PreStartup, Cleanliness>
Applies the dual reject transition and enters PreStartup.
Sourcepub fn legacy_error(
self,
) -> DualTypedSession<Transport, Terminated, Cleanliness>
pub fn legacy_error( self, ) -> DualTypedSession<Transport, Terminated, Cleanliness>
Applies the dual legacy_error transition and enters Terminated.
Source§impl<Transport, Cleanliness> DualTypedSession<Transport, AwaitingGssReply, Cleanliness>
impl<Transport, Cleanliness> DualTypedSession<Transport, AwaitingGssReply, Cleanliness>
Sourcepub fn accept(self) -> DualTypedSession<Transport, GssHandshake, Cleanliness>
pub fn accept(self) -> DualTypedSession<Transport, GssHandshake, Cleanliness>
Applies the dual accept transition and enters GssHandshake.
Sourcepub fn reject(self) -> DualTypedSession<Transport, PreStartup, Cleanliness>
pub fn reject(self) -> DualTypedSession<Transport, PreStartup, Cleanliness>
Applies the dual reject transition and enters PreStartup.
Sourcepub fn legacy_error(
self,
) -> DualTypedSession<Transport, Terminated, Cleanliness>
pub fn legacy_error( self, ) -> DualTypedSession<Transport, Terminated, Cleanliness>
Applies the dual legacy_error transition and enters Terminated.
Source§impl<Transport, Cleanliness> DualTypedSession<Transport, TlsHandshake, Cleanliness>
impl<Transport, Cleanliness> DualTypedSession<Transport, TlsHandshake, Cleanliness>
Sourcepub fn complete(self) -> DualTypedSession<Transport, PreStartup, Cleanliness>
pub fn complete(self) -> DualTypedSession<Transport, PreStartup, Cleanliness>
Applies the dual complete transition and enters PreStartup.
Source§impl<Transport, Cleanliness> DualTypedSession<Transport, GssHandshake, Cleanliness>
impl<Transport, Cleanliness> DualTypedSession<Transport, GssHandshake, Cleanliness>
Sourcepub fn complete(self) -> DualTypedSession<Transport, PreStartup, Cleanliness>
pub fn complete(self) -> DualTypedSession<Transport, PreStartup, Cleanliness>
Applies the dual complete transition and enters PreStartup.