pub enum TransportFrame {
Single(RawJsonRpcMessage),
Malformed {
raw: String,
error: Error,
},
Batch(TransportBatch),
}Expand description
A JSON-RPC frame exchanged between protocol components and transports.
A frame preserves the boundary between a single JSON-RPC value and a batch.
Malformed wire input is represented explicitly; transport failures are
reported by the future that drives the transport rather than sent through a
Channel.
Variants§
Single(RawJsonRpcMessage)
One valid JSON-RPC message.
Malformed
One malformed or invalid wire value retained for relays.
Fields
Batch(TransportBatch)
Entries retained from one non-empty JSON-RPC batch, kept in source order.
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 while preserving batch boundaries.
Every malformed value is retained as an explicit malformed frame or batch entry. Standalone malformed input keeps its original text; batch entries keep their parsed JSON values, source order, and batch boundary, though reserialization may normalize whitespace. 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
Source§fn clone(&self) -> TransportFrame
fn clone(&self) -> TransportFrame
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more