pub struct BinaryProtocol<F = Bytes>;
Expand description

A straight-forward binary format that encodes numeric values in fixed width.

let protocol = BinaryProtocol;
let transport = HttpClient::new(ENDPOINT)?;
let client = <dyn BuckGraphService>::new(protocol, transport);

The type parameter is the Framing expected by the transport on which this protocol is operating. Usually by convention the transport itself serves as the Framing impl, so for example in the case of HttpClient above, the compiler has inferred F = HttpClient.

Where the compiler reports that a Framing can’t be inferred, one can be specified explicitly:

let protocol = BinaryProtocol::<SRHeaderTransport>;

Trait Implementations§

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Type of the framing implementation
Compute the size of a frame for a given protocol. This can be exact or too large, but must not be too small.
Serialize into a buffer. The buffer is allocated with the size computed by Sizer, so it must be large enough.
Set up a deserializer from a frame’s buffer.

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.