pub enum RpcOutput {
Ready {
rpc_version: &'static str,
session_id: SessionId,
workspace_id: WorkspaceId,
},
Response {
rpc_version: &'static str,
id: Option<RpcRequestId>,
payload: RpcResponse,
},
Event {
rpc_version: &'static str,
payload: EventEnvelope,
},
CommandFinished {
rpc_version: &'static str,
command_id: CommandId,
session_id: SessionId,
error: Option<RpcError>,
},
ResnapshotRequired {
rpc_version: &'static str,
session_id: SessionId,
tail_sequence: SessionSequence,
},
}Expand description
One server output frame: correlated response or asynchronous canonical event.
Variants§
Ready
Initial connection metadata.
Fields
§
workspace_id: WorkspaceIdSafe canonical workspace identity.
Response
Correlated request response.
Fields
§
id: Option<RpcRequestId>Optional client correlation identity.
§
payload: RpcResponseTyped response payload.
Event
Asynchronous canonical event.
Fields
§
payload: EventEnvelopeUnchanged canonical runtime event envelope.
CommandFinished
Owned command task reached its terminal result.
Fields
ResnapshotRequired
The event subscription was replaced after a gap or rebind.
Implementations§
Source§impl RpcOutput
impl RpcOutput
Sourcepub const fn ready(session_id: SessionId, workspace_id: WorkspaceId) -> Self
pub const fn ready(session_id: SessionId, workspace_id: WorkspaceId) -> Self
Creates initial connection metadata.
Sourcepub const fn response(id: Option<RpcRequestId>, payload: RpcResponse) -> Self
pub const fn response(id: Option<RpcRequestId>, payload: RpcResponse) -> Self
Creates one correlated response frame.
Sourcepub const fn event(payload: EventEnvelope) -> Self
pub const fn event(payload: EventEnvelope) -> Self
Creates one asynchronous canonical event frame.
Sourcepub const fn command_finished(
command_id: CommandId,
session_id: SessionId,
error: Option<RpcError>,
) -> Self
pub const fn command_finished( command_id: CommandId, session_id: SessionId, error: Option<RpcError>, ) -> Self
Creates one asynchronous owned-command terminal notification.
Sourcepub const fn resnapshot_required(
session_id: SessionId,
tail_sequence: SessionSequence,
) -> Self
pub const fn resnapshot_required( session_id: SessionId, tail_sequence: SessionSequence, ) -> Self
Requires the client to rebuild from a durable snapshot page.
Sourcepub const fn error(id: Option<RpcRequestId>, error: RpcError) -> Self
pub const fn error(id: Option<RpcRequestId>, error: RpcError) -> Self
Creates one safe error response.
Trait Implementations§
impl StructuralPartialEq for RpcOutput
Auto Trait Implementations§
impl Freeze for RpcOutput
impl RefUnwindSafe for RpcOutput
impl Send for RpcOutput
impl Sync for RpcOutput
impl Unpin for RpcOutput
impl UnsafeUnpin for RpcOutput
impl UnwindSafe for RpcOutput
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more