Skip to main content

TypedSession

Struct TypedSession 

Source
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>

Source

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>

Source

pub fn map_transport<Next>( self, map: impl FnOnce(Transport) -> Next, ) -> TypedSession<Next, Phase, Cleanliness>

Replaces the transport representation without changing protocol indices.

Source

pub fn into_transport(self) -> Transport

Deliberately leaves the generated typestate API and returns its transport.

Source§

impl<Transport, Cleanliness> TypedSession<Transport, PreStartup, Cleanliness>

Source

pub fn ssl_request( self, ) -> TypedSession<Transport, AwaitingSslReply, Cleanliness>

Applies ssl_request and enters AwaitingSslReply.

Source

pub fn gss_request( self, ) -> TypedSession<Transport, AwaitingGssReply, Cleanliness>

Applies gss_request and enters AwaitingGssReply.

Source

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.

Source

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>

Source

pub fn accept(self) -> TypedSession<Transport, TlsHandshake, Cleanliness>

Applies accept and enters TlsHandshake.

Source

pub fn reject(self) -> TypedSession<Transport, PreStartup, Cleanliness>

Applies reject and enters PreStartup.

Source

pub fn legacy_error(self) -> TypedSession<Transport, Terminated, Cleanliness>

Applies legacy_error and enters Terminated.

Source§

impl<Transport, Cleanliness> TypedSession<Transport, AwaitingGssReply, Cleanliness>

Source

pub fn accept(self) -> TypedSession<Transport, GssHandshake, Cleanliness>

Applies accept and enters GssHandshake.

Source

pub fn reject(self) -> TypedSession<Transport, PreStartup, Cleanliness>

Applies reject and enters PreStartup.

Source

pub fn legacy_error(self) -> TypedSession<Transport, Terminated, Cleanliness>

Applies legacy_error and enters Terminated.

Source§

impl<Transport, Cleanliness> TypedSession<Transport, TlsHandshake, Cleanliness>

Source

pub fn complete(self) -> TypedSession<Transport, PreStartup, Cleanliness>

Applies complete and enters PreStartup.

Source§

impl<Transport, Cleanliness> TypedSession<Transport, GssHandshake, Cleanliness>

Source

pub fn complete(self) -> TypedSession<Transport, PreStartup, Cleanliness>

Applies complete and enters PreStartup.

Trait Implementations§

Source§

impl<Transport: Debug, Phase: Debug, Cleanliness: Debug> Debug for TypedSession<Transport, Phase, Cleanliness>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<Transport, Phase, Cleanliness> Freeze for TypedSession<Transport, Phase, Cleanliness>
where Transport: Freeze,

§

impl<Transport, Phase, Cleanliness> RefUnwindSafe for TypedSession<Transport, Phase, Cleanliness>
where Transport: RefUnwindSafe, Phase: RefUnwindSafe, Cleanliness: RefUnwindSafe,

§

impl<Transport, Phase, Cleanliness> Send for TypedSession<Transport, Phase, Cleanliness>
where Transport: Send, Phase: Send, Cleanliness: Send,

§

impl<Transport, Phase, Cleanliness> Sync for TypedSession<Transport, Phase, Cleanliness>
where Transport: Sync, Phase: Sync, Cleanliness: Sync,

§

impl<Transport, Phase, Cleanliness> Unpin for TypedSession<Transport, Phase, Cleanliness>
where Transport: Unpin, Phase: Unpin, Cleanliness: Unpin,

§

impl<Transport, Phase, Cleanliness> UnsafeUnpin for TypedSession<Transport, Phase, Cleanliness>
where Transport: UnsafeUnpin,

§

impl<Transport, Phase, Cleanliness> UnwindSafe for TypedSession<Transport, Phase, Cleanliness>
where Transport: UnwindSafe, Phase: UnwindSafe, Cleanliness: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where T: 'a,

Source§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

Source§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where T: 'a,

Source§

fn implicit( self, class: Class, constructed: bool, tag: u32, ) -> TaggedParser<'a, Implicit, Self, E>

Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.