pub struct TypedSession<Transport, Phase, Cleanliness = ()> { /* private fields */ }Expand description
Transport-carrying typestate for this protocol role.
Implementations§
Source§impl<Transport, SourceCleanliness> TypedSession<Transport, Ready, SourceCleanliness>
impl<Transport, SourceCleanliness> TypedSession<Transport, Ready, SourceCleanliness>
Sourcepub fn project_internal_message(
self,
message: ReadyInternalMessage,
) -> ReadyInternalProjection<Transport, SourceCleanliness>
pub fn project_internal_message( self, message: ReadyInternalMessage, ) -> ReadyInternalProjection<Transport, SourceCleanliness>
Projects one ReadyInternalMessage into its message-selected next connection.
Source§impl<Transport, SourceCleanliness> TypedSession<Transport, Ready, SourceCleanliness>
impl<Transport, SourceCleanliness> TypedSession<Transport, Ready, SourceCleanliness>
Sourcepub fn project_external_message(
self,
message: ReadyExternalMessage,
) -> ReadyExternalProjection<Transport, SourceCleanliness>
pub fn project_external_message( self, message: ReadyExternalMessage, ) -> ReadyExternalProjection<Transport, SourceCleanliness>
Projects one ReadyExternalMessage into its message-selected next connection.
Source§impl<Transport, SourceCleanliness> TypedSession<Transport, FunctionCalling, SourceCleanliness>
impl<Transport, SourceCleanliness> TypedSession<Transport, FunctionCalling, SourceCleanliness>
Sourcepub fn project_internal_message(
self,
message: FunctionCallingInternalMessage,
) -> FunctionCallingInternalProjection<Transport, SourceCleanliness>
pub fn project_internal_message( self, message: FunctionCallingInternalMessage, ) -> FunctionCallingInternalProjection<Transport, SourceCleanliness>
Projects one FunctionCallingInternalMessage into its message-selected next connection.
Source§impl<Transport, SourceCleanliness> TypedSession<Transport, FunctionCalling, SourceCleanliness>
impl<Transport, SourceCleanliness> TypedSession<Transport, FunctionCalling, SourceCleanliness>
Sourcepub fn project_external_message(
self,
message: FunctionCallingExternalMessage,
) -> FunctionCallingExternalProjection<Transport, SourceCleanliness>
pub fn project_external_message( self, message: FunctionCallingExternalMessage, ) -> FunctionCallingExternalProjection<Transport, SourceCleanliness>
Projects one FunctionCallingExternalMessage into its message-selected next connection.
Source§impl<Transport, SourceCleanliness> TypedSession<Transport, Simple, SourceCleanliness>
impl<Transport, SourceCleanliness> TypedSession<Transport, Simple, SourceCleanliness>
Sourcepub fn project_internal_message(
self,
message: SimpleInternalMessage,
) -> SimpleInternalProjection<Transport, SourceCleanliness>
pub fn project_internal_message( self, message: SimpleInternalMessage, ) -> SimpleInternalProjection<Transport, SourceCleanliness>
Projects one SimpleInternalMessage into its message-selected next connection.
Source§impl<Transport, SourceCleanliness> TypedSession<Transport, Simple, SourceCleanliness>
impl<Transport, SourceCleanliness> TypedSession<Transport, Simple, SourceCleanliness>
Sourcepub fn project_external_message(
self,
message: SimpleExternalMessage,
) -> SimpleExternalProjection<Transport, SourceCleanliness>
pub fn project_external_message( self, message: SimpleExternalMessage, ) -> SimpleExternalProjection<Transport, SourceCleanliness>
Projects one SimpleExternalMessage into its message-selected next connection.
Source§impl<Transport, SourceCleanliness> TypedSession<Transport, Building, SourceCleanliness>
impl<Transport, SourceCleanliness> TypedSession<Transport, Building, SourceCleanliness>
Sourcepub fn project_internal_message(
self,
message: BuildingInternalMessage,
) -> BuildingInternalProjection<Transport, SourceCleanliness>
pub fn project_internal_message( self, message: BuildingInternalMessage, ) -> BuildingInternalProjection<Transport, SourceCleanliness>
Projects one BuildingInternalMessage into its message-selected next connection.
Source§impl<Transport, SourceCleanliness> TypedSession<Transport, Building, SourceCleanliness>
impl<Transport, SourceCleanliness> TypedSession<Transport, Building, SourceCleanliness>
Sourcepub fn project_external_message(
self,
message: BuildingExternalMessage,
) -> BuildingExternalProjection<Transport, SourceCleanliness>
pub fn project_external_message( self, message: BuildingExternalMessage, ) -> BuildingExternalProjection<Transport, SourceCleanliness>
Projects one BuildingExternalMessage into its message-selected next connection.
Source§impl<Transport, SourceCleanliness> TypedSession<Transport, BoundBuilding, SourceCleanliness>
impl<Transport, SourceCleanliness> TypedSession<Transport, BoundBuilding, SourceCleanliness>
Sourcepub fn project_internal_message(
self,
message: BoundBuildingInternalMessage,
) -> BoundBuildingInternalProjection<Transport, SourceCleanliness>
pub fn project_internal_message( self, message: BoundBuildingInternalMessage, ) -> BoundBuildingInternalProjection<Transport, SourceCleanliness>
Projects one BoundBuildingInternalMessage into its message-selected next connection.
Source§impl<Transport, SourceCleanliness> TypedSession<Transport, BoundBuilding, SourceCleanliness>
impl<Transport, SourceCleanliness> TypedSession<Transport, BoundBuilding, SourceCleanliness>
Sourcepub fn project_external_message(
self,
message: BoundBuildingExternalMessage,
) -> BoundBuildingExternalProjection<Transport, SourceCleanliness>
pub fn project_external_message( self, message: BoundBuildingExternalMessage, ) -> BoundBuildingExternalProjection<Transport, SourceCleanliness>
Projects one BoundBuildingExternalMessage into its message-selected next connection.
Source§impl<Transport, SourceCleanliness> TypedSession<Transport, AwaitingReady, SourceCleanliness>
impl<Transport, SourceCleanliness> TypedSession<Transport, AwaitingReady, SourceCleanliness>
Sourcepub fn project_internal_message(
self,
message: AwaitingReadyInternalMessage,
) -> AwaitingReadyInternalProjection<Transport, SourceCleanliness>
pub fn project_internal_message( self, message: AwaitingReadyInternalMessage, ) -> AwaitingReadyInternalProjection<Transport, SourceCleanliness>
Projects one AwaitingReadyInternalMessage into its message-selected next connection.
Source§impl<Transport, SourceCleanliness> TypedSession<Transport, AwaitingReady, SourceCleanliness>
impl<Transport, SourceCleanliness> TypedSession<Transport, AwaitingReady, SourceCleanliness>
Sourcepub fn project_external_message(
self,
message: AwaitingReadyExternalMessage,
) -> AwaitingReadyExternalProjection<Transport, SourceCleanliness>
pub fn project_external_message( self, message: AwaitingReadyExternalMessage, ) -> AwaitingReadyExternalProjection<Transport, SourceCleanliness>
Projects one AwaitingReadyExternalMessage into its message-selected next connection.
Source§impl<Transport, SourceCleanliness> TypedSession<Transport, CopyIn, SourceCleanliness>
impl<Transport, SourceCleanliness> TypedSession<Transport, CopyIn, SourceCleanliness>
Sourcepub fn project_internal_message(
self,
message: CopyInInternalMessage,
) -> CopyInInternalProjection<Transport, SourceCleanliness>
pub fn project_internal_message( self, message: CopyInInternalMessage, ) -> CopyInInternalProjection<Transport, SourceCleanliness>
Projects one CopyInInternalMessage into its message-selected next connection.
Source§impl<Transport, SourceCleanliness> TypedSession<Transport, CopyIn, SourceCleanliness>
impl<Transport, SourceCleanliness> TypedSession<Transport, CopyIn, SourceCleanliness>
Sourcepub fn project_external_message(
self,
message: CopyInExternalMessage,
) -> CopyInExternalProjection<Transport, SourceCleanliness>
pub fn project_external_message( self, message: CopyInExternalMessage, ) -> CopyInExternalProjection<Transport, SourceCleanliness>
Projects one CopyInExternalMessage into its message-selected next connection.
Source§impl<Transport, SourceCleanliness> TypedSession<Transport, CopyOut, SourceCleanliness>
impl<Transport, SourceCleanliness> TypedSession<Transport, CopyOut, SourceCleanliness>
Sourcepub fn project_internal_message(
self,
message: CopyOutInternalMessage,
) -> CopyOutInternalProjection<Transport, SourceCleanliness>
pub fn project_internal_message( self, message: CopyOutInternalMessage, ) -> CopyOutInternalProjection<Transport, SourceCleanliness>
Projects one CopyOutInternalMessage into its message-selected next connection.
Source§impl<Transport, SourceCleanliness> TypedSession<Transport, CopyOut, SourceCleanliness>
impl<Transport, SourceCleanliness> TypedSession<Transport, CopyOut, SourceCleanliness>
Sourcepub fn project_external_message(
self,
message: CopyOutExternalMessage,
) -> CopyOutExternalProjection<Transport, SourceCleanliness>
pub fn project_external_message( self, message: CopyOutExternalMessage, ) -> CopyOutExternalProjection<Transport, SourceCleanliness>
Projects one CopyOutExternalMessage into its message-selected next connection.
Source§impl<Transport, SourceCleanliness> TypedSession<Transport, CopyBoth, SourceCleanliness>
impl<Transport, SourceCleanliness> TypedSession<Transport, CopyBoth, SourceCleanliness>
Sourcepub fn project_internal_message(
self,
message: CopyBothInternalMessage,
) -> CopyBothInternalProjection<Transport, SourceCleanliness>
pub fn project_internal_message( self, message: CopyBothInternalMessage, ) -> CopyBothInternalProjection<Transport, SourceCleanliness>
Projects one CopyBothInternalMessage into its message-selected next connection.
Source§impl<Transport, SourceCleanliness> TypedSession<Transport, CopyBoth, SourceCleanliness>
impl<Transport, SourceCleanliness> TypedSession<Transport, CopyBoth, SourceCleanliness>
Sourcepub fn project_external_message(
self,
message: CopyBothExternalMessage,
) -> CopyBothExternalProjection<Transport, SourceCleanliness>
pub fn project_external_message( self, message: CopyBothExternalMessage, ) -> CopyBothExternalProjection<Transport, SourceCleanliness>
Projects one CopyBothExternalMessage into its message-selected next connection.
Source§impl<Transport, SourceCleanliness> TypedSession<Transport, CopyBothClientDone, SourceCleanliness>
impl<Transport, SourceCleanliness> TypedSession<Transport, CopyBothClientDone, SourceCleanliness>
Sourcepub fn project_internal_message(
self,
message: CopyBothClientDoneInternalMessage,
) -> CopyBothClientDoneInternalProjection<Transport, SourceCleanliness>
pub fn project_internal_message( self, message: CopyBothClientDoneInternalMessage, ) -> CopyBothClientDoneInternalProjection<Transport, SourceCleanliness>
Projects one CopyBothClientDoneInternalMessage into its message-selected next connection.
Source§impl<Transport, SourceCleanliness> TypedSession<Transport, CopyBothClientDone, SourceCleanliness>
impl<Transport, SourceCleanliness> TypedSession<Transport, CopyBothClientDone, SourceCleanliness>
Sourcepub fn project_external_message(
self,
message: CopyBothClientDoneExternalMessage,
) -> CopyBothClientDoneExternalProjection<Transport, SourceCleanliness>
pub fn project_external_message( self, message: CopyBothClientDoneExternalMessage, ) -> CopyBothClientDoneExternalProjection<Transport, SourceCleanliness>
Projects one CopyBothClientDoneExternalMessage into its message-selected next connection.
Source§impl<Transport, SourceCleanliness> TypedSession<Transport, CopyBothServerDone, SourceCleanliness>
impl<Transport, SourceCleanliness> TypedSession<Transport, CopyBothServerDone, SourceCleanliness>
Sourcepub fn project_internal_message(
self,
message: CopyBothServerDoneInternalMessage,
) -> CopyBothServerDoneInternalProjection<Transport, SourceCleanliness>
pub fn project_internal_message( self, message: CopyBothServerDoneInternalMessage, ) -> CopyBothServerDoneInternalProjection<Transport, SourceCleanliness>
Projects one CopyBothServerDoneInternalMessage into its message-selected next connection.
Source§impl<Transport, SourceCleanliness> TypedSession<Transport, CopyBothServerDone, SourceCleanliness>
impl<Transport, SourceCleanliness> TypedSession<Transport, CopyBothServerDone, SourceCleanliness>
Sourcepub fn project_external_message(
self,
message: CopyBothServerDoneExternalMessage,
) -> CopyBothServerDoneExternalProjection<Transport, SourceCleanliness>
pub fn project_external_message( self, message: CopyBothServerDoneExternalMessage, ) -> CopyBothServerDoneExternalProjection<Transport, SourceCleanliness>
Projects one CopyBothServerDoneExternalMessage into its message-selected next connection.
Source§impl<Transport, SourceCleanliness> TypedSession<Transport, Draining, SourceCleanliness>
impl<Transport, SourceCleanliness> TypedSession<Transport, Draining, SourceCleanliness>
Sourcepub fn project_internal_message(
self,
message: DrainingInternalMessage,
) -> DrainingInternalProjection<Transport, SourceCleanliness>
pub fn project_internal_message( self, message: DrainingInternalMessage, ) -> DrainingInternalProjection<Transport, SourceCleanliness>
Projects one DrainingInternalMessage into its message-selected next connection.
Source§impl<Transport, SourceCleanliness> TypedSession<Transport, Draining, SourceCleanliness>
impl<Transport, SourceCleanliness> TypedSession<Transport, Draining, SourceCleanliness>
Sourcepub fn project_external_message(
self,
message: DrainingExternalMessage,
) -> DrainingExternalProjection<Transport, SourceCleanliness>
pub fn project_external_message( self, message: DrainingExternalMessage, ) -> DrainingExternalProjection<Transport, SourceCleanliness>
Projects one DrainingExternalMessage into its message-selected next connection.
Source§impl<Transport, SourceCleanliness> TypedSession<Transport, Resetting, SourceCleanliness>
impl<Transport, SourceCleanliness> TypedSession<Transport, Resetting, SourceCleanliness>
Sourcepub fn project_internal_message(
self,
message: ResettingInternalMessage,
) -> ResettingInternalProjection<Transport, SourceCleanliness>
pub fn project_internal_message( self, message: ResettingInternalMessage, ) -> ResettingInternalProjection<Transport, SourceCleanliness>
Projects one ResettingInternalMessage into its message-selected next connection.
Source§impl<Transport, SourceCleanliness> TypedSession<Transport, Resetting, SourceCleanliness>
impl<Transport, SourceCleanliness> TypedSession<Transport, Resetting, SourceCleanliness>
Sourcepub fn project_external_message(
self,
message: ResettingExternalMessage,
) -> ResettingExternalProjection<Transport, SourceCleanliness>
pub fn project_external_message( self, message: ResettingExternalMessage, ) -> ResettingExternalProjection<Transport, SourceCleanliness>
Projects one ResettingExternalMessage into its message-selected next connection.
Source§impl<Transport, SourceCleanliness> TypedSession<Transport, ResetComplete, SourceCleanliness>
impl<Transport, SourceCleanliness> TypedSession<Transport, ResetComplete, SourceCleanliness>
Sourcepub fn project_internal_message(
self,
message: ResetCompleteInternalMessage,
) -> ResetCompleteInternalProjection<Transport, SourceCleanliness>
pub fn project_internal_message( self, message: ResetCompleteInternalMessage, ) -> ResetCompleteInternalProjection<Transport, SourceCleanliness>
Projects one ResetCompleteInternalMessage into its message-selected next connection.
Source§impl<Transport, SourceCleanliness> TypedSession<Transport, ResetComplete, SourceCleanliness>
impl<Transport, SourceCleanliness> TypedSession<Transport, ResetComplete, SourceCleanliness>
Sourcepub fn project_external_message(
self,
message: ResetCompleteExternalMessage,
) -> ResetCompleteExternalProjection<Transport, SourceCleanliness>
pub fn project_external_message( self, message: ResetCompleteExternalMessage, ) -> ResetCompleteExternalProjection<Transport, SourceCleanliness>
Projects one ResetCompleteExternalMessage 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, Ready, Cleanliness>
impl<Transport, Cleanliness> TypedSession<Transport, Ready, 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, Ready, Cleanliness>
impl<Transport, Cleanliness> TypedSession<Transport, Ready, Cleanliness>
Sourcepub fn query<Output, Error>(
self,
payload: Bytes,
handle: impl FnOnce(&mut Transport, Bytes) -> Result<Output, Error>,
) -> Result<(TypedSession<Transport, Simple, Dirty>, Output), (Self, Error)>
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.
Sourcepub fn begin_extended(self) -> TypedSession<Transport, Building, Cleanliness>
pub fn begin_extended(self) -> TypedSession<Transport, Building, Cleanliness>
Applies begin_extended and enters Building.
Sourcepub fn function_call<Output, Error>(
self,
payload: FunctionCall,
handle: impl FnOnce(&mut Transport, FunctionCall) -> Result<Output, Error>,
) -> Result<(TypedSession<Transport, FunctionCalling, Dirty>, Output), (Self, Error)>
pub fn function_call<Output, Error>( self, payload: FunctionCall, handle: impl FnOnce(&mut Transport, FunctionCall) -> Result<Output, Error>, ) -> Result<(TypedSession<Transport, FunctionCalling, Dirty>, Output), (Self, Error)>
Handles the payload for function_call; success enters FunctionCalling and failure returns the unchanged session.
Sourcepub fn reset(self) -> TypedSession<Transport, Resetting, Dirty>
pub fn reset(self) -> TypedSession<Transport, Resetting, Dirty>
Applies reset and enters Resetting.
Sourcepub fn terminate(self) -> TypedSession<Transport, Terminated, Cleanliness>
pub fn terminate(self) -> TypedSession<Transport, Terminated, Cleanliness>
Applies terminate and enters Terminated.
Source§impl<Transport, Cleanliness> TypedSession<Transport, FunctionCalling, Cleanliness>
impl<Transport, Cleanliness> TypedSession<Transport, FunctionCalling, Cleanliness>
Sourcepub fn function_response<Output, Error>(
self,
payload: Bytes,
handle: impl FnOnce(&mut Transport, Bytes) -> Result<Output, Error>,
) -> Result<(TypedSession<Transport, AwaitingReady, Cleanliness>, Output), (Self, Error)>
pub fn function_response<Output, Error>( self, payload: Bytes, handle: impl FnOnce(&mut Transport, Bytes) -> Result<Output, Error>, ) -> Result<(TypedSession<Transport, AwaitingReady, Cleanliness>, Output), (Self, Error)>
Handles the payload for function_response; success enters AwaitingReady and failure returns the unchanged session.
Sourcepub fn error<Output, Error>(
self,
payload: DiagnosticResponse,
handle: impl FnOnce(&mut Transport, DiagnosticResponse) -> Result<Output, Error>,
) -> Result<(TypedSession<Transport, Draining, Cleanliness>, Output), (Self, Error)>
pub fn error<Output, Error>( self, payload: DiagnosticResponse, handle: impl FnOnce(&mut Transport, DiagnosticResponse) -> Result<Output, Error>, ) -> Result<(TypedSession<Transport, Draining, Cleanliness>, Output), (Self, Error)>
Handles the payload for error; success enters Draining and failure returns the unchanged session.
Source§impl<Transport, Cleanliness> TypedSession<Transport, Simple, Cleanliness>
impl<Transport, Cleanliness> TypedSession<Transport, Simple, Cleanliness>
Sourcepub 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)>
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.
Sourcepub fn enter_copy_in<Output, Error>(
self,
payload: CopyResponse,
handle: impl FnOnce(&mut Transport, CopyResponse) -> Result<Output, Error>,
) -> Result<(TypedSession<Transport, CopyIn, Cleanliness>, Output), (Self, Error)>
pub fn enter_copy_in<Output, Error>( self, payload: CopyResponse, handle: impl FnOnce(&mut Transport, CopyResponse) -> Result<Output, Error>, ) -> Result<(TypedSession<Transport, CopyIn, Cleanliness>, Output), (Self, Error)>
Handles the payload for enter_copy_in; success enters CopyIn and failure returns the unchanged session.
Sourcepub fn enter_copy_out<Output, Error>(
self,
payload: CopyResponse,
handle: impl FnOnce(&mut Transport, CopyResponse) -> Result<Output, Error>,
) -> Result<(TypedSession<Transport, CopyOut, Cleanliness>, Output), (Self, Error)>
pub fn enter_copy_out<Output, Error>( self, payload: CopyResponse, handle: impl FnOnce(&mut Transport, CopyResponse) -> Result<Output, Error>, ) -> Result<(TypedSession<Transport, CopyOut, Cleanliness>, Output), (Self, Error)>
Handles the payload for enter_copy_out; success enters CopyOut and failure returns the unchanged session.
Sourcepub fn enter_copy_both<Output, Error>(
self,
payload: CopyResponse,
handle: impl FnOnce(&mut Transport, CopyResponse) -> Result<Output, Error>,
) -> Result<(TypedSession<Transport, CopyBoth, Cleanliness>, Output), (Self, Error)>
pub fn enter_copy_both<Output, Error>( self, payload: CopyResponse, handle: impl FnOnce(&mut Transport, CopyResponse) -> Result<Output, Error>, ) -> Result<(TypedSession<Transport, CopyBoth, Cleanliness>, Output), (Self, Error)>
Handles the payload for enter_copy_both; success enters CopyBoth and failure returns the unchanged session.
Sourcepub fn ready<Output, Error>(
self,
payload: TransactionStatus,
handle: impl FnOnce(&mut Transport, TransactionStatus) -> Result<Output, Error>,
) -> Result<(TypedSession<Transport, Ready, Cleanliness>, Output), (Self, Error)>
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.
Sourcepub fn error<Output, Error>(
self,
payload: DiagnosticResponse,
handle: impl FnOnce(&mut Transport, DiagnosticResponse) -> Result<Output, Error>,
) -> Result<(TypedSession<Transport, Draining, Cleanliness>, Output), (Self, Error)>
pub fn error<Output, Error>( self, payload: DiagnosticResponse, handle: impl FnOnce(&mut Transport, DiagnosticResponse) -> Result<Output, Error>, ) -> Result<(TypedSession<Transport, Draining, Cleanliness>, Output), (Self, Error)>
Handles the payload for error; success enters Draining and failure returns the unchanged session.
Source§impl<Transport, Cleanliness> TypedSession<Transport, Building, Cleanliness>
impl<Transport, Cleanliness> TypedSession<Transport, Building, Cleanliness>
Sourcepub fn parse<Output, Error>(
self,
payload: Parse,
handle: impl FnOnce(&mut Transport, Parse) -> Result<Output, Error>,
) -> Result<(TypedSession<Transport, Building, Dirty>, Output), (Self, Error)>
pub fn parse<Output, Error>( self, payload: Parse, handle: impl FnOnce(&mut Transport, Parse) -> Result<Output, Error>, ) -> Result<(TypedSession<Transport, Building, Dirty>, Output), (Self, Error)>
Handles the payload for parse; success enters Building and failure returns the unchanged session.
Sourcepub fn describe<Output, Error>(
self,
payload: Describe,
handle: impl FnOnce(&mut Transport, Describe) -> Result<Output, Error>,
) -> Result<(TypedSession<Transport, Building, Cleanliness>, Output), (Self, Error)>
pub fn describe<Output, Error>( self, payload: Describe, handle: impl FnOnce(&mut Transport, Describe) -> Result<Output, Error>, ) -> Result<(TypedSession<Transport, Building, Cleanliness>, Output), (Self, Error)>
Handles the payload for describe; success enters Building and failure returns the unchanged session.
Sourcepub fn bind<Output, Error>(
self,
payload: Bind,
handle: impl FnOnce(&mut Transport, Bind) -> Result<Output, Error>,
) -> Result<(TypedSession<Transport, BoundBuilding, Dirty>, Output), (Self, Error)>
pub fn bind<Output, Error>( self, payload: Bind, handle: impl FnOnce(&mut Transport, Bind) -> Result<Output, Error>, ) -> Result<(TypedSession<Transport, BoundBuilding, Dirty>, Output), (Self, Error)>
Handles the payload for bind; success enters BoundBuilding and failure returns the unchanged session.
Sourcepub fn close<Output, Error>(
self,
payload: Close,
handle: impl FnOnce(&mut Transport, Close) -> Result<Output, Error>,
) -> Result<(TypedSession<Transport, Building, Cleanliness>, Output), (Self, Error)>
pub fn close<Output, Error>( self, payload: Close, handle: impl FnOnce(&mut Transport, Close) -> Result<Output, Error>, ) -> Result<(TypedSession<Transport, Building, Cleanliness>, Output), (Self, Error)>
Handles the payload for close; success enters Building and failure returns the unchanged session.
Sourcepub fn flush(self) -> TypedSession<Transport, Building, Cleanliness>
pub fn flush(self) -> TypedSession<Transport, Building, Cleanliness>
Applies flush and enters Building.
Sourcepub fn sync(self) -> TypedSession<Transport, AwaitingReady, Cleanliness>
pub fn sync(self) -> TypedSession<Transport, AwaitingReady, Cleanliness>
Applies sync and enters AwaitingReady.
Source§impl<Transport, Cleanliness> TypedSession<Transport, BoundBuilding, Cleanliness>
impl<Transport, Cleanliness> TypedSession<Transport, BoundBuilding, Cleanliness>
Sourcepub fn parse<Output, Error>(
self,
payload: Parse,
handle: impl FnOnce(&mut Transport, Parse) -> Result<Output, Error>,
) -> Result<(TypedSession<Transport, BoundBuilding, Dirty>, Output), (Self, Error)>
pub fn parse<Output, Error>( self, payload: Parse, handle: impl FnOnce(&mut Transport, Parse) -> Result<Output, Error>, ) -> Result<(TypedSession<Transport, BoundBuilding, Dirty>, Output), (Self, Error)>
Handles the payload for parse; success enters BoundBuilding and failure returns the unchanged session.
Sourcepub fn describe<Output, Error>(
self,
payload: Describe,
handle: impl FnOnce(&mut Transport, Describe) -> Result<Output, Error>,
) -> Result<(TypedSession<Transport, BoundBuilding, Cleanliness>, Output), (Self, Error)>
pub fn describe<Output, Error>( self, payload: Describe, handle: impl FnOnce(&mut Transport, Describe) -> Result<Output, Error>, ) -> Result<(TypedSession<Transport, BoundBuilding, Cleanliness>, Output), (Self, Error)>
Handles the payload for describe; success enters BoundBuilding and failure returns the unchanged session.
Sourcepub fn bind<Output, Error>(
self,
payload: Bind,
handle: impl FnOnce(&mut Transport, Bind) -> Result<Output, Error>,
) -> Result<(TypedSession<Transport, BoundBuilding, Dirty>, Output), (Self, Error)>
pub fn bind<Output, Error>( self, payload: Bind, handle: impl FnOnce(&mut Transport, Bind) -> Result<Output, Error>, ) -> Result<(TypedSession<Transport, BoundBuilding, Dirty>, Output), (Self, Error)>
Handles the payload for bind; success enters BoundBuilding and failure returns the unchanged session.
Sourcepub fn execute<Output, Error>(
self,
payload: Execute,
handle: impl FnOnce(&mut Transport, Execute) -> Result<Output, Error>,
) -> Result<(TypedSession<Transport, BoundBuilding, Cleanliness>, Output), (Self, Error)>
pub fn execute<Output, Error>( self, payload: Execute, handle: impl FnOnce(&mut Transport, Execute) -> Result<Output, Error>, ) -> Result<(TypedSession<Transport, BoundBuilding, Cleanliness>, Output), (Self, Error)>
Handles the payload for execute; success enters BoundBuilding and failure returns the unchanged session.
Sourcepub fn close<Output, Error>(
self,
payload: Close,
handle: impl FnOnce(&mut Transport, Close) -> Result<Output, Error>,
) -> Result<(TypedSession<Transport, BoundBuilding, Cleanliness>, Output), (Self, Error)>
pub fn close<Output, Error>( self, payload: Close, handle: impl FnOnce(&mut Transport, Close) -> Result<Output, Error>, ) -> Result<(TypedSession<Transport, BoundBuilding, Cleanliness>, Output), (Self, Error)>
Handles the payload for close; success enters BoundBuilding and failure returns the unchanged session.
Sourcepub fn flush(self) -> TypedSession<Transport, BoundBuilding, Cleanliness>
pub fn flush(self) -> TypedSession<Transport, BoundBuilding, Cleanliness>
Applies flush and enters BoundBuilding.
Sourcepub fn sync(self) -> TypedSession<Transport, AwaitingReady, Cleanliness>
pub fn sync(self) -> TypedSession<Transport, AwaitingReady, Cleanliness>
Applies sync and enters AwaitingReady.
Source§impl<Transport, Cleanliness> TypedSession<Transport, AwaitingReady, Cleanliness>
impl<Transport, Cleanliness> TypedSession<Transport, AwaitingReady, Cleanliness>
Sourcepub fn continue_response<Output, Error>(
self,
payload: BackendMessage,
handle: impl FnOnce(&mut Transport, BackendMessage) -> Result<Output, Error>,
) -> Result<(TypedSession<Transport, AwaitingReady, Cleanliness>, Output), (Self, Error)>
pub fn continue_response<Output, Error>( self, payload: BackendMessage, handle: impl FnOnce(&mut Transport, BackendMessage) -> Result<Output, Error>, ) -> Result<(TypedSession<Transport, AwaitingReady, Cleanliness>, Output), (Self, Error)>
Handles the payload for continue_response; success enters AwaitingReady and failure returns the unchanged session.
Sourcepub fn ready<Output, Error>(
self,
payload: TransactionStatus,
handle: impl FnOnce(&mut Transport, TransactionStatus) -> Result<Output, Error>,
) -> Result<(TypedSession<Transport, Ready, Cleanliness>, Output), (Self, Error)>
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.
Sourcepub fn error<Output, Error>(
self,
payload: DiagnosticResponse,
handle: impl FnOnce(&mut Transport, DiagnosticResponse) -> Result<Output, Error>,
) -> Result<(TypedSession<Transport, Draining, Cleanliness>, Output), (Self, Error)>
pub fn error<Output, Error>( self, payload: DiagnosticResponse, handle: impl FnOnce(&mut Transport, DiagnosticResponse) -> Result<Output, Error>, ) -> Result<(TypedSession<Transport, Draining, Cleanliness>, Output), (Self, Error)>
Handles the payload for error; success enters Draining and failure returns the unchanged session.
Source§impl<Transport, Cleanliness> TypedSession<Transport, CopyIn, Cleanliness>
impl<Transport, Cleanliness> TypedSession<Transport, CopyIn, Cleanliness>
Sourcepub fn copy_data<Output, Error>(
self,
payload: Bytes,
handle: impl FnOnce(&mut Transport, Bytes) -> Result<Output, Error>,
) -> Result<(TypedSession<Transport, CopyIn, Cleanliness>, Output), (Self, Error)>
pub fn copy_data<Output, Error>( self, payload: Bytes, handle: impl FnOnce(&mut Transport, Bytes) -> Result<Output, Error>, ) -> Result<(TypedSession<Transport, CopyIn, Cleanliness>, Output), (Self, Error)>
Handles the payload for copy_data; success enters CopyIn and failure returns the unchanged session.
Sourcepub fn copy_done(self) -> TypedSession<Transport, AwaitingReady, Cleanliness>
pub fn copy_done(self) -> TypedSession<Transport, AwaitingReady, Cleanliness>
Applies copy_done and enters AwaitingReady.
Sourcepub fn copy_fail<Output, Error>(
self,
payload: Bytes,
handle: impl FnOnce(&mut Transport, Bytes) -> Result<Output, Error>,
) -> Result<(TypedSession<Transport, AwaitingReady, Cleanliness>, Output), (Self, Error)>
pub fn copy_fail<Output, Error>( self, payload: Bytes, handle: impl FnOnce(&mut Transport, Bytes) -> Result<Output, Error>, ) -> Result<(TypedSession<Transport, AwaitingReady, Cleanliness>, Output), (Self, Error)>
Handles the payload for copy_fail; success enters AwaitingReady and failure returns the unchanged session.
Sourcepub fn error<Output, Error>(
self,
payload: DiagnosticResponse,
handle: impl FnOnce(&mut Transport, DiagnosticResponse) -> Result<Output, Error>,
) -> Result<(TypedSession<Transport, Draining, Cleanliness>, Output), (Self, Error)>
pub fn error<Output, Error>( self, payload: DiagnosticResponse, handle: impl FnOnce(&mut Transport, DiagnosticResponse) -> Result<Output, Error>, ) -> Result<(TypedSession<Transport, Draining, Cleanliness>, Output), (Self, Error)>
Handles the payload for error; success enters Draining and failure returns the unchanged session.
Source§impl<Transport, Cleanliness> TypedSession<Transport, CopyOut, Cleanliness>
impl<Transport, Cleanliness> TypedSession<Transport, CopyOut, Cleanliness>
Sourcepub fn copy_data<Output, Error>(
self,
payload: Bytes,
handle: impl FnOnce(&mut Transport, Bytes) -> Result<Output, Error>,
) -> Result<(TypedSession<Transport, CopyOut, Cleanliness>, Output), (Self, Error)>
pub fn copy_data<Output, Error>( self, payload: Bytes, handle: impl FnOnce(&mut Transport, Bytes) -> Result<Output, Error>, ) -> Result<(TypedSession<Transport, CopyOut, Cleanliness>, Output), (Self, Error)>
Handles the payload for copy_data; success enters CopyOut and failure returns the unchanged session.
Sourcepub fn copy_done(self) -> TypedSession<Transport, AwaitingReady, Cleanliness>
pub fn copy_done(self) -> TypedSession<Transport, AwaitingReady, Cleanliness>
Applies copy_done and enters AwaitingReady.
Sourcepub fn error<Output, Error>(
self,
payload: DiagnosticResponse,
handle: impl FnOnce(&mut Transport, DiagnosticResponse) -> Result<Output, Error>,
) -> Result<(TypedSession<Transport, Draining, Cleanliness>, Output), (Self, Error)>
pub fn error<Output, Error>( self, payload: DiagnosticResponse, handle: impl FnOnce(&mut Transport, DiagnosticResponse) -> Result<Output, Error>, ) -> Result<(TypedSession<Transport, Draining, Cleanliness>, Output), (Self, Error)>
Handles the payload for error; success enters Draining and failure returns the unchanged session.
Source§impl<Transport, Cleanliness> TypedSession<Transport, CopyBoth, Cleanliness>
impl<Transport, Cleanliness> TypedSession<Transport, CopyBoth, Cleanliness>
Sourcepub fn send_copy_data<Output, Error>(
self,
payload: Bytes,
handle: impl FnOnce(&mut Transport, Bytes) -> Result<Output, Error>,
) -> Result<(TypedSession<Transport, CopyBoth, Cleanliness>, Output), (Self, Error)>
pub fn send_copy_data<Output, Error>( self, payload: Bytes, handle: impl FnOnce(&mut Transport, Bytes) -> Result<Output, Error>, ) -> Result<(TypedSession<Transport, CopyBoth, Cleanliness>, Output), (Self, Error)>
Handles the payload for send_copy_data; success enters CopyBoth and failure returns the unchanged session.
Sourcepub fn receive_copy_data<Output, Error>(
self,
payload: Bytes,
handle: impl FnOnce(&mut Transport, Bytes) -> Result<Output, Error>,
) -> Result<(TypedSession<Transport, CopyBoth, Cleanliness>, Output), (Self, Error)>
pub fn receive_copy_data<Output, Error>( self, payload: Bytes, handle: impl FnOnce(&mut Transport, Bytes) -> Result<Output, Error>, ) -> Result<(TypedSession<Transport, CopyBoth, Cleanliness>, Output), (Self, Error)>
Handles the payload for receive_copy_data; success enters CopyBoth and failure returns the unchanged session.
Sourcepub fn send_copy_done(
self,
) -> TypedSession<Transport, CopyBothClientDone, Cleanliness>
pub fn send_copy_done( self, ) -> TypedSession<Transport, CopyBothClientDone, Cleanliness>
Applies send_copy_done and enters CopyBothClientDone.
Sourcepub fn receive_copy_done(
self,
) -> TypedSession<Transport, CopyBothServerDone, Cleanliness>
pub fn receive_copy_done( self, ) -> TypedSession<Transport, CopyBothServerDone, Cleanliness>
Applies receive_copy_done and enters CopyBothServerDone.
Sourcepub fn error<Output, Error>(
self,
payload: DiagnosticResponse,
handle: impl FnOnce(&mut Transport, DiagnosticResponse) -> Result<Output, Error>,
) -> Result<(TypedSession<Transport, Draining, Cleanliness>, Output), (Self, Error)>
pub fn error<Output, Error>( self, payload: DiagnosticResponse, handle: impl FnOnce(&mut Transport, DiagnosticResponse) -> Result<Output, Error>, ) -> Result<(TypedSession<Transport, Draining, Cleanliness>, Output), (Self, Error)>
Handles the payload for error; success enters Draining and failure returns the unchanged session.
Source§impl<Transport, Cleanliness> TypedSession<Transport, CopyBothClientDone, Cleanliness>
impl<Transport, Cleanliness> TypedSession<Transport, CopyBothClientDone, Cleanliness>
Sourcepub fn receive_copy_data<Output, Error>(
self,
payload: Bytes,
handle: impl FnOnce(&mut Transport, Bytes) -> Result<Output, Error>,
) -> Result<(TypedSession<Transport, CopyBothClientDone, Cleanliness>, Output), (Self, Error)>
pub fn receive_copy_data<Output, Error>( self, payload: Bytes, handle: impl FnOnce(&mut Transport, Bytes) -> Result<Output, Error>, ) -> Result<(TypedSession<Transport, CopyBothClientDone, Cleanliness>, Output), (Self, Error)>
Handles the payload for receive_copy_data; success enters CopyBothClientDone and failure returns the unchanged session.
Sourcepub fn receive_copy_done(
self,
) -> TypedSession<Transport, AwaitingReady, Cleanliness>
pub fn receive_copy_done( self, ) -> TypedSession<Transport, AwaitingReady, Cleanliness>
Applies receive_copy_done and enters AwaitingReady.
Sourcepub fn error<Output, Error>(
self,
payload: DiagnosticResponse,
handle: impl FnOnce(&mut Transport, DiagnosticResponse) -> Result<Output, Error>,
) -> Result<(TypedSession<Transport, Draining, Cleanliness>, Output), (Self, Error)>
pub fn error<Output, Error>( self, payload: DiagnosticResponse, handle: impl FnOnce(&mut Transport, DiagnosticResponse) -> Result<Output, Error>, ) -> Result<(TypedSession<Transport, Draining, Cleanliness>, Output), (Self, Error)>
Handles the payload for error; success enters Draining and failure returns the unchanged session.
Source§impl<Transport, Cleanliness> TypedSession<Transport, CopyBothServerDone, Cleanliness>
impl<Transport, Cleanliness> TypedSession<Transport, CopyBothServerDone, Cleanliness>
Sourcepub fn send_copy_data<Output, Error>(
self,
payload: Bytes,
handle: impl FnOnce(&mut Transport, Bytes) -> Result<Output, Error>,
) -> Result<(TypedSession<Transport, CopyBothServerDone, Cleanliness>, Output), (Self, Error)>
pub fn send_copy_data<Output, Error>( self, payload: Bytes, handle: impl FnOnce(&mut Transport, Bytes) -> Result<Output, Error>, ) -> Result<(TypedSession<Transport, CopyBothServerDone, Cleanliness>, Output), (Self, Error)>
Handles the payload for send_copy_data; success enters CopyBothServerDone and failure returns the unchanged session.
Sourcepub fn send_copy_done(
self,
) -> TypedSession<Transport, AwaitingReady, Cleanliness>
pub fn send_copy_done( self, ) -> TypedSession<Transport, AwaitingReady, Cleanliness>
Applies send_copy_done and enters AwaitingReady.
Source§impl<Transport, Cleanliness> TypedSession<Transport, Draining, Cleanliness>
impl<Transport, Cleanliness> TypedSession<Transport, Draining, Cleanliness>
Sourcepub fn continue_response<Output, Error>(
self,
payload: BackendMessage,
handle: impl FnOnce(&mut Transport, BackendMessage) -> Result<Output, Error>,
) -> Result<(TypedSession<Transport, Draining, Cleanliness>, Output), (Self, Error)>
pub fn continue_response<Output, Error>( self, payload: BackendMessage, handle: impl FnOnce(&mut Transport, BackendMessage) -> Result<Output, Error>, ) -> Result<(TypedSession<Transport, Draining, Cleanliness>, Output), (Self, Error)>
Handles the payload for continue_response; success enters Draining and failure returns the unchanged session.
Sourcepub fn ready<Output, Error>(
self,
payload: TransactionStatus,
handle: impl FnOnce(&mut Transport, TransactionStatus) -> Result<Output, Error>,
) -> Result<(TypedSession<Transport, Ready, Cleanliness>, Output), (Self, Error)>
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, Resetting, Cleanliness>
impl<Transport, Cleanliness> TypedSession<Transport, Resetting, Cleanliness>
Sourcepub fn continue_reset<Output, Error>(
self,
payload: BackendMessage,
handle: impl FnOnce(&mut Transport, BackendMessage) -> Result<Output, Error>,
) -> Result<(TypedSession<Transport, Resetting, Cleanliness>, Output), (Self, Error)>
pub fn continue_reset<Output, Error>( self, payload: BackendMessage, handle: impl FnOnce(&mut Transport, BackendMessage) -> Result<Output, Error>, ) -> Result<(TypedSession<Transport, Resetting, Cleanliness>, Output), (Self, Error)>
Handles the payload for continue_reset; success enters Resetting and failure returns the unchanged session.
Sourcepub fn discard_complete<Output, Error>(
self,
payload: Bytes,
handle: impl FnOnce(&mut Transport, Bytes) -> Result<Output, Error>,
) -> Result<(TypedSession<Transport, ResetComplete, Cleanliness>, Output), (Self, Error)>
pub fn discard_complete<Output, Error>( self, payload: Bytes, handle: impl FnOnce(&mut Transport, Bytes) -> Result<Output, Error>, ) -> Result<(TypedSession<Transport, ResetComplete, Cleanliness>, Output), (Self, Error)>
Handles the payload for discard_complete; success enters ResetComplete and failure returns the unchanged session.
Sourcepub fn error<Output, Error>(
self,
payload: DiagnosticResponse,
handle: impl FnOnce(&mut Transport, DiagnosticResponse) -> Result<Output, Error>,
) -> Result<(TypedSession<Transport, Draining, Cleanliness>, Output), (Self, Error)>
pub fn error<Output, Error>( self, payload: DiagnosticResponse, handle: impl FnOnce(&mut Transport, DiagnosticResponse) -> Result<Output, Error>, ) -> Result<(TypedSession<Transport, Draining, Cleanliness>, Output), (Self, Error)>
Handles the payload for error; success enters Draining and failure returns the unchanged session.
Source§impl<Transport, Cleanliness> TypedSession<Transport, ResetComplete, Cleanliness>
impl<Transport, Cleanliness> TypedSession<Transport, ResetComplete, Cleanliness>
Sourcepub fn continue_reset<Output, Error>(
self,
payload: BackendMessage,
handle: impl FnOnce(&mut Transport, BackendMessage) -> Result<Output, Error>,
) -> Result<(TypedSession<Transport, ResetComplete, Cleanliness>, Output), (Self, Error)>
pub fn continue_reset<Output, Error>( self, payload: BackendMessage, handle: impl FnOnce(&mut Transport, BackendMessage) -> Result<Output, Error>, ) -> Result<(TypedSession<Transport, ResetComplete, Cleanliness>, Output), (Self, Error)>
Handles the payload for continue_reset; success enters ResetComplete and failure returns the unchanged session.
Sourcepub fn ready_clean<Output, Error>(
self,
payload: TransactionStatus,
handle: impl FnOnce(&mut Transport, TransactionStatus) -> Result<Output, Error>,
) -> Result<(TypedSession<Transport, Ready, Pristine>, Output), (Self, Error)>
pub fn ready_clean<Output, Error>( self, payload: TransactionStatus, handle: impl FnOnce(&mut Transport, TransactionStatus) -> Result<Output, Error>, ) -> Result<(TypedSession<Transport, Ready, Pristine>, Output), (Self, Error)>
Handles the payload for ready_clean; success enters Ready and failure returns the unchanged session.
Sourcepub fn ready_dirty<Output, Error>(
self,
payload: TransactionStatus,
handle: impl FnOnce(&mut Transport, TransactionStatus) -> Result<Output, Error>,
) -> Result<(TypedSession<Transport, Ready, Dirty>, Output), (Self, Error)>
pub fn ready_dirty<Output, Error>( self, payload: TransactionStatus, handle: impl FnOnce(&mut Transport, TransactionStatus) -> Result<Output, Error>, ) -> Result<(TypedSession<Transport, Ready, Dirty>, Output), (Self, Error)>
Handles the payload for ready_dirty; success enters Ready and failure returns the unchanged session.
Sourcepub fn error<Output, Error>(
self,
payload: DiagnosticResponse,
handle: impl FnOnce(&mut Transport, DiagnosticResponse) -> Result<Output, Error>,
) -> Result<(TypedSession<Transport, Draining, Cleanliness>, Output), (Self, Error)>
pub fn error<Output, Error>( self, payload: DiagnosticResponse, handle: impl FnOnce(&mut Transport, DiagnosticResponse) -> Result<Output, Error>, ) -> Result<(TypedSession<Transport, Draining, Cleanliness>, Output), (Self, Error)>
Handles the payload for error; success enters Draining and failure returns the unchanged session.