pub struct TypedSession<Transport, Phase, Cleanliness = ()> { /* private fields */ }Expand description
Transport-carrying typestate for this protocol role.
Implementations§
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.