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, Ready, 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, Ready, Cleanliness>

Source

pub fn query<Output, Error>( self, payload: Bytes, handle: impl FnOnce(&mut Transport, Bytes) -> Result<Output, Error>, ) -> Result<(TypedSession<Transport, Simple, Dirty>, Output), (Self, Error)>

Handles the payload for query; success enters Simple and failure returns the unchanged session.

Source

pub fn parse<Output, Error>( self, payload: Parse, handle: impl FnOnce(&mut Transport, Parse) -> Result<Output, Error>, ) -> Result<(TypedSession<Transport, ParseResponse, Dirty>, Output), (Self, Error)>

Handles the payload for parse; success enters ParseResponse and failure returns the unchanged session.

Source

pub fn bind<Output, Error>( self, payload: Bind, handle: impl FnOnce(&mut Transport, Bind) -> Result<Output, Error>, ) -> Result<(TypedSession<Transport, BindResponse, Dirty>, Output), (Self, Error)>

Handles the payload for bind; success enters BindResponse and failure returns the unchanged session.

Source

pub fn describe<Output, Error>( self, payload: Describe, handle: impl FnOnce(&mut Transport, Describe) -> Result<Output, Error>, ) -> Result<(TypedSession<Transport, DescribeResponse, Cleanliness>, Output), (Self, Error)>

Handles the payload for describe; success enters DescribeResponse and failure returns the unchanged session.

Source

pub fn execute<Output, Error>( self, payload: Execute, handle: impl FnOnce(&mut Transport, Execute) -> Result<Output, Error>, ) -> Result<(TypedSession<Transport, ExecuteResponse, Dirty>, Output), (Self, Error)>

Handles the payload for execute; success enters ExecuteResponse and failure returns the unchanged session.

Source

pub fn close<Output, Error>( self, payload: Close, handle: impl FnOnce(&mut Transport, Close) -> Result<Output, Error>, ) -> Result<(TypedSession<Transport, CloseResponse, Cleanliness>, Output), (Self, Error)>

Handles the payload for close; success enters CloseResponse and failure returns the unchanged session.

Source

pub fn function_call<Output, Error>( self, payload: FunctionCall, handle: impl FnOnce(&mut Transport, FunctionCall) -> Result<Output, Error>, ) -> Result<(TypedSession<Transport, FunctionResponse, Dirty>, Output), (Self, Error)>

Handles the payload for function_call; success enters FunctionResponse and failure returns the unchanged session.

Source

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

Applies terminate and enters Terminated.

Source§

impl<Transport, Cleanliness> TypedSession<Transport, Simple, Cleanliness>

Source

pub fn continue_response<Output, Error>( self, payload: BackendMessage, handle: impl FnOnce(&mut Transport, BackendMessage) -> Result<Output, Error>, ) -> Result<(TypedSession<Transport, Simple, Cleanliness>, Output), (Self, Error)>

Handles the payload for continue_response; success enters Simple and failure returns the unchanged session.

Source

pub fn copy_in<Output, Error>( self, payload: CopyResponse, handle: impl FnOnce(&mut Transport, CopyResponse) -> Result<Output, Error>, ) -> Result<(TypedSession<Transport, SimpleCopyIn, Cleanliness>, Output), (Self, Error)>

Handles the payload for copy_in; success enters SimpleCopyIn and failure returns the unchanged session.

Source

pub fn copy_out<Output, Error>( self, payload: CopyResponse, handle: impl FnOnce(&mut Transport, CopyResponse) -> Result<Output, Error>, ) -> Result<(TypedSession<Transport, SimpleCopyOut, Cleanliness>, Output), (Self, Error)>

Handles the payload for copy_out; success enters SimpleCopyOut and failure returns the unchanged session.

Source

pub fn copy_both<Output, Error>( self, payload: CopyResponse, handle: impl FnOnce(&mut Transport, CopyResponse) -> Result<Output, Error>, ) -> Result<(TypedSession<Transport, SimpleCopyBoth, Cleanliness>, Output), (Self, Error)>

Handles the payload for copy_both; success enters SimpleCopyBoth and failure returns the unchanged session.

Source

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.

Source

pub fn error<Output, Error>( self, payload: DiagnosticResponse, handle: impl FnOnce(&mut Transport, DiagnosticResponse) -> Result<Output, Error>, ) -> Result<(TypedSession<Transport, SimpleError, Cleanliness>, Output), (Self, Error)>

Handles the payload for error; success enters SimpleError and failure returns the unchanged session.

Source§

impl<Transport, Cleanliness> TypedSession<Transport, SimpleError, Cleanliness>

Source

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.

Source§

impl<Transport, Cleanliness> TypedSession<Transport, Building, Cleanliness>

Source

pub fn parse<Output, Error>( self, payload: Parse, handle: impl FnOnce(&mut Transport, Parse) -> Result<Output, Error>, ) -> Result<(TypedSession<Transport, ParseResponse, Dirty>, Output), (Self, Error)>

Handles the payload for parse; success enters ParseResponse and failure returns the unchanged session.

Source

pub fn bind<Output, Error>( self, payload: Bind, handle: impl FnOnce(&mut Transport, Bind) -> Result<Output, Error>, ) -> Result<(TypedSession<Transport, BindResponse, Dirty>, Output), (Self, Error)>

Handles the payload for bind; success enters BindResponse and failure returns the unchanged session.

Source

pub fn describe<Output, Error>( self, payload: Describe, handle: impl FnOnce(&mut Transport, Describe) -> Result<Output, Error>, ) -> Result<(TypedSession<Transport, DescribeResponse, Cleanliness>, Output), (Self, Error)>

Handles the payload for describe; success enters DescribeResponse and failure returns the unchanged session.

Source

pub fn execute<Output, Error>( self, payload: Execute, handle: impl FnOnce(&mut Transport, Execute) -> Result<Output, Error>, ) -> Result<(TypedSession<Transport, ExecuteResponse, Dirty>, Output), (Self, Error)>

Handles the payload for execute; success enters ExecuteResponse and failure returns the unchanged session.

Source

pub fn close<Output, Error>( self, payload: Close, handle: impl FnOnce(&mut Transport, Close) -> Result<Output, Error>, ) -> Result<(TypedSession<Transport, CloseResponse, Cleanliness>, Output), (Self, Error)>

Handles the payload for close; success enters CloseResponse and failure returns the unchanged session.

Source

pub fn flush(self) -> TypedSession<Transport, Building, Cleanliness>

Applies flush and enters Building.

Source

pub fn sync(self) -> TypedSession<Transport, SyncResponse, Cleanliness>

Applies sync and enters SyncResponse.

Source§

impl<Transport, Cleanliness> TypedSession<Transport, ParseResponse, Cleanliness>

Source

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

Applies complete and enters Building.

Source

pub fn error<Output, Error>( self, payload: DiagnosticResponse, handle: impl FnOnce(&mut Transport, DiagnosticResponse) -> Result<Output, Error>, ) -> Result<(TypedSession<Transport, ExtendedError, Cleanliness>, Output), (Self, Error)>

Handles the payload for error; success enters ExtendedError and failure returns the unchanged session.

Source§

impl<Transport, Cleanliness> TypedSession<Transport, BindResponse, Cleanliness>

Source

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

Applies complete and enters Building.

Source

pub fn error<Output, Error>( self, payload: DiagnosticResponse, handle: impl FnOnce(&mut Transport, DiagnosticResponse) -> Result<Output, Error>, ) -> Result<(TypedSession<Transport, ExtendedError, Cleanliness>, Output), (Self, Error)>

Handles the payload for error; success enters ExtendedError and failure returns the unchanged session.

Source§

impl<Transport, Cleanliness> TypedSession<Transport, DescribeResponse, Cleanliness>

Source

pub fn row_description<Output, Error>( self, payload: RowDescription, handle: impl FnOnce(&mut Transport, RowDescription) -> Result<Output, Error>, ) -> Result<(TypedSession<Transport, Building, Cleanliness>, Output), (Self, Error)>

Handles the payload for row_description; success enters Building and failure returns the unchanged session.

Source

pub fn no_data(self) -> TypedSession<Transport, Building, Cleanliness>

Applies no_data and enters Building.

Source

pub fn error<Output, Error>( self, payload: DiagnosticResponse, handle: impl FnOnce(&mut Transport, DiagnosticResponse) -> Result<Output, Error>, ) -> Result<(TypedSession<Transport, ExtendedError, Cleanliness>, Output), (Self, Error)>

Handles the payload for error; success enters ExtendedError and failure returns the unchanged session.

Source§

impl<Transport, Cleanliness> TypedSession<Transport, ExecuteResponse, Cleanliness>

Source

pub fn continue_response<Output, Error>( self, payload: BackendMessage, handle: impl FnOnce(&mut Transport, BackendMessage) -> Result<Output, Error>, ) -> Result<(TypedSession<Transport, ExecuteResponse, Cleanliness>, Output), (Self, Error)>

Handles the payload for continue_response; success enters ExecuteResponse and failure returns the unchanged session.

Source

pub fn copy_in<Output, Error>( self, payload: CopyResponse, handle: impl FnOnce(&mut Transport, CopyResponse) -> Result<Output, Error>, ) -> Result<(TypedSession<Transport, ExtendedCopyIn, Cleanliness>, Output), (Self, Error)>

Handles the payload for copy_in; success enters ExtendedCopyIn and failure returns the unchanged session.

Source

pub fn copy_out<Output, Error>( self, payload: CopyResponse, handle: impl FnOnce(&mut Transport, CopyResponse) -> Result<Output, Error>, ) -> Result<(TypedSession<Transport, ExtendedCopyOut, Cleanliness>, Output), (Self, Error)>

Handles the payload for copy_out; success enters ExtendedCopyOut and failure returns the unchanged session.

Source

pub fn copy_both<Output, Error>( self, payload: CopyResponse, handle: impl FnOnce(&mut Transport, CopyResponse) -> Result<Output, Error>, ) -> Result<(TypedSession<Transport, ExtendedCopyBoth, Cleanliness>, Output), (Self, Error)>

Handles the payload for copy_both; success enters ExtendedCopyBoth and failure returns the unchanged session.

Source

pub fn command_complete<Output, Error>( self, payload: Bytes, handle: impl FnOnce(&mut Transport, Bytes) -> Result<Output, Error>, ) -> Result<(TypedSession<Transport, Building, Cleanliness>, Output), (Self, Error)>

Handles the payload for command_complete; success enters Building and failure returns the unchanged session.

Source

pub fn portal_suspended(self) -> TypedSession<Transport, Building, Cleanliness>

Applies portal_suspended and enters Building.

Source

pub fn error<Output, Error>( self, payload: DiagnosticResponse, handle: impl FnOnce(&mut Transport, DiagnosticResponse) -> Result<Output, Error>, ) -> Result<(TypedSession<Transport, ExtendedError, Cleanliness>, Output), (Self, Error)>

Handles the payload for error; success enters ExtendedError and failure returns the unchanged session.

Source§

impl<Transport, Cleanliness> TypedSession<Transport, CloseResponse, Cleanliness>

Source

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

Applies complete and enters Building.

Source

pub fn error<Output, Error>( self, payload: DiagnosticResponse, handle: impl FnOnce(&mut Transport, DiagnosticResponse) -> Result<Output, Error>, ) -> Result<(TypedSession<Transport, ExtendedError, Cleanliness>, Output), (Self, Error)>

Handles the payload for error; success enters ExtendedError and failure returns the unchanged session.

Source§

impl<Transport, Cleanliness> TypedSession<Transport, ExtendedError, Cleanliness>

Source

pub fn discard(self) -> TypedSession<Transport, ExtendedError, Cleanliness>

Applies discard and enters ExtendedError.

Source

pub fn sync(self) -> TypedSession<Transport, SyncResponse, Cleanliness>

Applies sync and enters SyncResponse.

Source§

impl<Transport, Cleanliness> TypedSession<Transport, SyncResponse, Cleanliness>

Source

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.

Source§

impl<Transport, Cleanliness> TypedSession<Transport, FunctionResponse, Cleanliness>

Source

pub fn result<Output, Error>( self, payload: Bytes, handle: impl FnOnce(&mut Transport, Bytes) -> Result<Output, Error>, ) -> Result<(TypedSession<Transport, FunctionReady, Cleanliness>, Output), (Self, Error)>

Handles the payload for result; success enters FunctionReady and failure returns the unchanged session.

Source

pub fn error<Output, Error>( self, payload: DiagnosticResponse, handle: impl FnOnce(&mut Transport, DiagnosticResponse) -> Result<Output, Error>, ) -> Result<(TypedSession<Transport, FunctionReady, Cleanliness>, Output), (Self, Error)>

Handles the payload for error; success enters FunctionReady and failure returns the unchanged session.

Source§

impl<Transport, Cleanliness> TypedSession<Transport, FunctionReady, Cleanliness>

Source

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.

Source§

impl<Transport, Cleanliness> TypedSession<Transport, SimpleCopyIn, Cleanliness>

Source

pub fn data<Output, Error>( self, payload: Bytes, handle: impl FnOnce(&mut Transport, Bytes) -> Result<Output, Error>, ) -> Result<(TypedSession<Transport, SimpleCopyIn, Cleanliness>, Output), (Self, Error)>

Handles the payload for data; success enters SimpleCopyIn and failure returns the unchanged session.

Source

pub fn done(self) -> TypedSession<Transport, SimpleCopyInDone, Cleanliness>

Applies done and enters SimpleCopyInDone.

Source

pub fn fail<Output, Error>( self, payload: Bytes, handle: impl FnOnce(&mut Transport, Bytes) -> Result<Output, Error>, ) -> Result<(TypedSession<Transport, SimpleCopyInFailed, Cleanliness>, Output), (Self, Error)>

Handles the payload for fail; success enters SimpleCopyInFailed and failure returns the unchanged session.

Source§

impl<Transport, Cleanliness> TypedSession<Transport, SimpleCopyInDone, Cleanliness>

Source

pub fn command_complete<Output, Error>( self, payload: Bytes, handle: impl FnOnce(&mut Transport, Bytes) -> Result<Output, Error>, ) -> Result<(TypedSession<Transport, SimpleCopyReady, Cleanliness>, Output), (Self, Error)>

Handles the payload for command_complete; success enters SimpleCopyReady and failure returns the unchanged session.

Source§

impl<Transport, Cleanliness> TypedSession<Transport, SimpleCopyInFailed, Cleanliness>

Source

pub fn error<Output, Error>( self, payload: DiagnosticResponse, handle: impl FnOnce(&mut Transport, DiagnosticResponse) -> Result<Output, Error>, ) -> Result<(TypedSession<Transport, SimpleCopyReady, Cleanliness>, Output), (Self, Error)>

Handles the payload for error; success enters SimpleCopyReady and failure returns the unchanged session.

Source§

impl<Transport, Cleanliness> TypedSession<Transport, SimpleCopyOut, Cleanliness>

Source

pub fn data<Output, Error>( self, payload: Bytes, handle: impl FnOnce(&mut Transport, Bytes) -> Result<Output, Error>, ) -> Result<(TypedSession<Transport, SimpleCopyOut, Cleanliness>, Output), (Self, Error)>

Handles the payload for data; success enters SimpleCopyOut and failure returns the unchanged session.

Source

pub fn done(self) -> TypedSession<Transport, SimpleCopyOutDone, Cleanliness>

Applies done and enters SimpleCopyOutDone.

Source

pub fn error<Output, Error>( self, payload: DiagnosticResponse, handle: impl FnOnce(&mut Transport, DiagnosticResponse) -> Result<Output, Error>, ) -> Result<(TypedSession<Transport, SimpleCopyReady, Cleanliness>, Output), (Self, Error)>

Handles the payload for error; success enters SimpleCopyReady and failure returns the unchanged session.

Source§

impl<Transport, Cleanliness> TypedSession<Transport, SimpleCopyOutDone, Cleanliness>

Source

pub fn command_complete<Output, Error>( self, payload: Bytes, handle: impl FnOnce(&mut Transport, Bytes) -> Result<Output, Error>, ) -> Result<(TypedSession<Transport, SimpleCopyReady, Cleanliness>, Output), (Self, Error)>

Handles the payload for command_complete; success enters SimpleCopyReady and failure returns the unchanged session.

Source§

impl<Transport, Cleanliness> TypedSession<Transport, SimpleCopyReady, Cleanliness>

Source

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.

Source§

impl<Transport, Cleanliness> TypedSession<Transport, ExtendedCopyIn, Cleanliness>

Source

pub fn data<Output, Error>( self, payload: Bytes, handle: impl FnOnce(&mut Transport, Bytes) -> Result<Output, Error>, ) -> Result<(TypedSession<Transport, ExtendedCopyIn, Cleanliness>, Output), (Self, Error)>

Handles the payload for data; success enters ExtendedCopyIn and failure returns the unchanged session.

Source

pub fn done(self) -> TypedSession<Transport, ExtendedCopyInDone, Cleanliness>

Applies done and enters ExtendedCopyInDone.

Source

pub fn fail<Output, Error>( self, payload: Bytes, handle: impl FnOnce(&mut Transport, Bytes) -> Result<Output, Error>, ) -> Result<(TypedSession<Transport, ExtendedCopyInFailed, Cleanliness>, Output), (Self, Error)>

Handles the payload for fail; success enters ExtendedCopyInFailed and failure returns the unchanged session.

Source§

impl<Transport, Cleanliness> TypedSession<Transport, ExtendedCopyInDone, Cleanliness>

Source

pub fn command_complete<Output, Error>( self, payload: Bytes, handle: impl FnOnce(&mut Transport, Bytes) -> Result<Output, Error>, ) -> Result<(TypedSession<Transport, Building, Cleanliness>, Output), (Self, Error)>

Handles the payload for command_complete; success enters Building and failure returns the unchanged session.

Source§

impl<Transport, Cleanliness> TypedSession<Transport, ExtendedCopyInFailed, Cleanliness>

Source

pub fn error<Output, Error>( self, payload: DiagnosticResponse, handle: impl FnOnce(&mut Transport, DiagnosticResponse) -> Result<Output, Error>, ) -> Result<(TypedSession<Transport, ExtendedError, Cleanliness>, Output), (Self, Error)>

Handles the payload for error; success enters ExtendedError and failure returns the unchanged session.

Source§

impl<Transport, Cleanliness> TypedSession<Transport, ExtendedCopyOut, Cleanliness>

Source

pub fn data<Output, Error>( self, payload: Bytes, handle: impl FnOnce(&mut Transport, Bytes) -> Result<Output, Error>, ) -> Result<(TypedSession<Transport, ExtendedCopyOut, Cleanliness>, Output), (Self, Error)>

Handles the payload for data; success enters ExtendedCopyOut and failure returns the unchanged session.

Source

pub fn done(self) -> TypedSession<Transport, ExtendedCopyOutDone, Cleanliness>

Applies done and enters ExtendedCopyOutDone.

Source

pub fn error<Output, Error>( self, payload: DiagnosticResponse, handle: impl FnOnce(&mut Transport, DiagnosticResponse) -> Result<Output, Error>, ) -> Result<(TypedSession<Transport, ExtendedError, Cleanliness>, Output), (Self, Error)>

Handles the payload for error; success enters ExtendedError and failure returns the unchanged session.

Source§

impl<Transport, Cleanliness> TypedSession<Transport, ExtendedCopyOutDone, Cleanliness>

Source

pub fn command_complete<Output, Error>( self, payload: Bytes, handle: impl FnOnce(&mut Transport, Bytes) -> Result<Output, Error>, ) -> Result<(TypedSession<Transport, Building, Cleanliness>, Output), (Self, Error)>

Handles the payload for command_complete; success enters Building and failure returns the unchanged session.

Source§

impl<Transport, Cleanliness> TypedSession<Transport, SimpleCopyBoth, Cleanliness>

Source

pub fn send_data<Output, Error>( self, payload: Bytes, handle: impl FnOnce(&mut Transport, Bytes) -> Result<Output, Error>, ) -> Result<(TypedSession<Transport, SimpleCopyBoth, Cleanliness>, Output), (Self, Error)>

Handles the payload for send_data; success enters SimpleCopyBoth and failure returns the unchanged session.

Source

pub fn receive_data<Output, Error>( self, payload: Bytes, handle: impl FnOnce(&mut Transport, Bytes) -> Result<Output, Error>, ) -> Result<(TypedSession<Transport, SimpleCopyBoth, Cleanliness>, Output), (Self, Error)>

Handles the payload for receive_data; success enters SimpleCopyBoth and failure returns the unchanged session.

Source

pub fn send_done( self, ) -> TypedSession<Transport, SimpleCopyBothServerDone, Cleanliness>

Applies send_done and enters SimpleCopyBothServerDone.

Source

pub fn receive_done( self, ) -> TypedSession<Transport, SimpleCopyBothClientDone, Cleanliness>

Applies receive_done and enters SimpleCopyBothClientDone.

Source

pub fn fail<Output, Error>( self, payload: Bytes, handle: impl FnOnce(&mut Transport, Bytes) -> Result<Output, Error>, ) -> Result<(TypedSession<Transport, SimpleCopyBothFailed, Cleanliness>, Output), (Self, Error)>

Handles the payload for fail; success enters SimpleCopyBothFailed and failure returns the unchanged session.

Source

pub fn error<Output, Error>( self, payload: DiagnosticResponse, handle: impl FnOnce(&mut Transport, DiagnosticResponse) -> Result<Output, Error>, ) -> Result<(TypedSession<Transport, SimpleCopyReady, Cleanliness>, Output), (Self, Error)>

Handles the payload for error; success enters SimpleCopyReady and failure returns the unchanged session.

Source§

impl<Transport, Cleanliness> TypedSession<Transport, SimpleCopyBothClientDone, Cleanliness>

Source

pub fn send_data<Output, Error>( self, payload: Bytes, handle: impl FnOnce(&mut Transport, Bytes) -> Result<Output, Error>, ) -> Result<(TypedSession<Transport, SimpleCopyBothClientDone, Cleanliness>, Output), (Self, Error)>

Handles the payload for send_data; success enters SimpleCopyBothClientDone and failure returns the unchanged session.

Source

pub fn send_done( self, ) -> TypedSession<Transport, SimpleCopyBothDone, Cleanliness>

Applies send_done and enters SimpleCopyBothDone.

Source

pub fn error<Output, Error>( self, payload: DiagnosticResponse, handle: impl FnOnce(&mut Transport, DiagnosticResponse) -> Result<Output, Error>, ) -> Result<(TypedSession<Transport, SimpleCopyReady, Cleanliness>, Output), (Self, Error)>

Handles the payload for error; success enters SimpleCopyReady and failure returns the unchanged session.

Source§

impl<Transport, Cleanliness> TypedSession<Transport, SimpleCopyBothServerDone, Cleanliness>

Source

pub fn receive_data<Output, Error>( self, payload: Bytes, handle: impl FnOnce(&mut Transport, Bytes) -> Result<Output, Error>, ) -> Result<(TypedSession<Transport, SimpleCopyBothServerDone, Cleanliness>, Output), (Self, Error)>

Handles the payload for receive_data; success enters SimpleCopyBothServerDone and failure returns the unchanged session.

Source

pub fn receive_done( self, ) -> TypedSession<Transport, SimpleCopyBothDone, Cleanliness>

Applies receive_done and enters SimpleCopyBothDone.

Source

pub fn fail<Output, Error>( self, payload: Bytes, handle: impl FnOnce(&mut Transport, Bytes) -> Result<Output, Error>, ) -> Result<(TypedSession<Transport, SimpleCopyBothFailed, Cleanliness>, Output), (Self, Error)>

Handles the payload for fail; success enters SimpleCopyBothFailed and failure returns the unchanged session.

Source§

impl<Transport, Cleanliness> TypedSession<Transport, SimpleCopyBothDone, Cleanliness>

Source

pub fn command_complete<Output, Error>( self, payload: Bytes, handle: impl FnOnce(&mut Transport, Bytes) -> Result<Output, Error>, ) -> Result<(TypedSession<Transport, SimpleCopyReady, Cleanliness>, Output), (Self, Error)>

Handles the payload for command_complete; success enters SimpleCopyReady and failure returns the unchanged session.

Source§

impl<Transport, Cleanliness> TypedSession<Transport, SimpleCopyBothFailed, Cleanliness>

Source

pub fn error<Output, Error>( self, payload: DiagnosticResponse, handle: impl FnOnce(&mut Transport, DiagnosticResponse) -> Result<Output, Error>, ) -> Result<(TypedSession<Transport, SimpleCopyReady, Cleanliness>, Output), (Self, Error)>

Handles the payload for error; success enters SimpleCopyReady and failure returns the unchanged session.

Source§

impl<Transport, Cleanliness> TypedSession<Transport, ExtendedCopyBoth, Cleanliness>

Source

pub fn send_data<Output, Error>( self, payload: Bytes, handle: impl FnOnce(&mut Transport, Bytes) -> Result<Output, Error>, ) -> Result<(TypedSession<Transport, ExtendedCopyBoth, Cleanliness>, Output), (Self, Error)>

Handles the payload for send_data; success enters ExtendedCopyBoth and failure returns the unchanged session.

Source

pub fn receive_data<Output, Error>( self, payload: Bytes, handle: impl FnOnce(&mut Transport, Bytes) -> Result<Output, Error>, ) -> Result<(TypedSession<Transport, ExtendedCopyBoth, Cleanliness>, Output), (Self, Error)>

Handles the payload for receive_data; success enters ExtendedCopyBoth and failure returns the unchanged session.

Source

pub fn send_done( self, ) -> TypedSession<Transport, ExtendedCopyBothServerDone, Cleanliness>

Applies send_done and enters ExtendedCopyBothServerDone.

Source

pub fn receive_done( self, ) -> TypedSession<Transport, ExtendedCopyBothClientDone, Cleanliness>

Applies receive_done and enters ExtendedCopyBothClientDone.

Source

pub fn fail<Output, Error>( self, payload: Bytes, handle: impl FnOnce(&mut Transport, Bytes) -> Result<Output, Error>, ) -> Result<(TypedSession<Transport, ExtendedCopyBothFailed, Cleanliness>, Output), (Self, Error)>

Handles the payload for fail; success enters ExtendedCopyBothFailed and failure returns the unchanged session.

Source

pub fn error<Output, Error>( self, payload: DiagnosticResponse, handle: impl FnOnce(&mut Transport, DiagnosticResponse) -> Result<Output, Error>, ) -> Result<(TypedSession<Transport, ExtendedError, Cleanliness>, Output), (Self, Error)>

Handles the payload for error; success enters ExtendedError and failure returns the unchanged session.

Source§

impl<Transport, Cleanliness> TypedSession<Transport, ExtendedCopyBothClientDone, Cleanliness>

Source

pub fn send_data<Output, Error>( self, payload: Bytes, handle: impl FnOnce(&mut Transport, Bytes) -> Result<Output, Error>, ) -> Result<(TypedSession<Transport, ExtendedCopyBothClientDone, Cleanliness>, Output), (Self, Error)>

Handles the payload for send_data; success enters ExtendedCopyBothClientDone and failure returns the unchanged session.

Source

pub fn send_done( self, ) -> TypedSession<Transport, ExtendedCopyBothDone, Cleanliness>

Applies send_done and enters ExtendedCopyBothDone.

Source

pub fn error<Output, Error>( self, payload: DiagnosticResponse, handle: impl FnOnce(&mut Transport, DiagnosticResponse) -> Result<Output, Error>, ) -> Result<(TypedSession<Transport, ExtendedError, Cleanliness>, Output), (Self, Error)>

Handles the payload for error; success enters ExtendedError and failure returns the unchanged session.

Source§

impl<Transport, Cleanliness> TypedSession<Transport, ExtendedCopyBothServerDone, Cleanliness>

Source

pub fn receive_data<Output, Error>( self, payload: Bytes, handle: impl FnOnce(&mut Transport, Bytes) -> Result<Output, Error>, ) -> Result<(TypedSession<Transport, ExtendedCopyBothServerDone, Cleanliness>, Output), (Self, Error)>

Handles the payload for receive_data; success enters ExtendedCopyBothServerDone and failure returns the unchanged session.

Source

pub fn receive_done( self, ) -> TypedSession<Transport, ExtendedCopyBothDone, Cleanliness>

Applies receive_done and enters ExtendedCopyBothDone.

Source

pub fn fail<Output, Error>( self, payload: Bytes, handle: impl FnOnce(&mut Transport, Bytes) -> Result<Output, Error>, ) -> Result<(TypedSession<Transport, ExtendedCopyBothFailed, Cleanliness>, Output), (Self, Error)>

Handles the payload for fail; success enters ExtendedCopyBothFailed and failure returns the unchanged session.

Source§

impl<Transport, Cleanliness> TypedSession<Transport, ExtendedCopyBothDone, Cleanliness>

Source

pub fn command_complete<Output, Error>( self, payload: Bytes, handle: impl FnOnce(&mut Transport, Bytes) -> Result<Output, Error>, ) -> Result<(TypedSession<Transport, Building, Cleanliness>, Output), (Self, Error)>

Handles the payload for command_complete; success enters Building and failure returns the unchanged session.

Source§

impl<Transport, Cleanliness> TypedSession<Transport, ExtendedCopyBothFailed, Cleanliness>

Source

pub fn error<Output, Error>( self, payload: DiagnosticResponse, handle: impl FnOnce(&mut Transport, DiagnosticResponse) -> Result<Output, Error>, ) -> Result<(TypedSession<Transport, ExtendedError, Cleanliness>, Output), (Self, Error)>

Handles the payload for error; success enters ExtendedError and failure returns the unchanged session.

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.