#[non_exhaustive]pub enum TransportFrame {
Single(RawJsonRpcMessage),
Malformed {
raw: String,
error: Error,
},
}Expand description
A JSON-RPC frame exchanged between protocol components and transports.
A frame is one JSON-RPC wire value. Malformed wire input, including a
JSON-RPC batch array, which the SDK does not support, is represented
explicitly; transport failures are reported by the future that drives the
transport rather than sent through a Channel.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Single(RawJsonRpcMessage)
One valid JSON-RPC message.
Malformed
One malformed or invalid wire value retained for relays.
Implementations§
Source§impl TransportFrame
impl TransportFrame
Sourcepub fn parse_json(input: &str) -> Self
pub fn parse_json(input: &str) -> Self
Parse one JSON-RPC wire value.
Every malformed value is retained as an explicit malformed frame with
its original text. JSON-RPC batches are not supported: a JSON array is
a malformed frame with an invalid-request (-32600) error. Protocol
actors decide whether a malformed value is call-shaped and requires an
Error Response.
Trait Implementations§
Source§impl Clone for TransportFrame
impl Clone for TransportFrame
Auto Trait Implementations§
impl Freeze for TransportFrame
impl RefUnwindSafe for TransportFrame
impl Send for TransportFrame
impl Sync for TransportFrame
impl Unpin for TransportFrame
impl UnsafeUnpin for TransportFrame
impl UnwindSafe for TransportFrame
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
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> IntoMaybeUndefined<T> for T
impl<T> IntoMaybeUndefined<T> for T
Source§fn into_maybe_undefined(self) -> MaybeUndefined<T>
fn into_maybe_undefined(self) -> MaybeUndefined<T>
Converts this value into a three-state builder argument.
Source§impl<T> IntoOption<T> for T
impl<T> IntoOption<T> for T
Source§fn into_option(self) -> Option<T>
fn into_option(self) -> Option<T>
Converts this value into an optional builder argument.