[−][src]Enum fbthrift_git::compact_protocol::CompactProtocol
An efficient, dense encoding that uses variable-length integers and squeezes data into unused bits wherever possible.
let protocol = CompactProtocol; let transport = HttpClient::new(ENDPOINT)?; let client = 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 = CompactProtocol::<SRHeaderTransport>;
Variants
Trait Implementations
impl<F> Clone for CompactProtocol<F>
[src]
fn clone(&self) -> Self
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl<F> Copy for CompactProtocol<F>
[src]
impl<F> Protocol for CompactProtocol<F> where
F: Framing + 'static,
[src]
F: Framing + 'static,
type Frame = F
Type of the framing implementation
type Sizer = CompactProtocolSerializer<SizeCounter>
Compute the size of a frame for a given protocol. This can be exact or too large, but must not be too small. Read more
type Serializer = CompactProtocolSerializer<F::EncBuf>
Serialize into a buffer. The buffer is allocated with the size computed by Sizer, so it must be large enough. Read more
type Deserializer = CompactProtocolDeserializer<F::DecBuf>
Set up a deserializer from a frame's buffer.
const PROTOCOL_ID: ProtocolID
[src]
fn serializer<SZ, SER>(
size: SZ,
ser: SER
) -> <Self::Serializer as ProtocolWriter>::Final where
SZ: FnOnce(&mut Self::Sizer),
SER: FnOnce(&mut Self::Serializer),
[src]
size: SZ,
ser: SER
) -> <Self::Serializer as ProtocolWriter>::Final where
SZ: FnOnce(&mut Self::Sizer),
SER: FnOnce(&mut Self::Serializer),
fn deserializer(buf: F::DecBuf) -> Self::Deserializer
[src]
fn into_buffer(deser: Self::Deserializer) -> F::DecBuf
[src]
Auto Trait Implementations
impl<F> RefUnwindSafe for CompactProtocol<F> where
F: RefUnwindSafe,
F: RefUnwindSafe,
impl<F> Send for CompactProtocol<F> where
F: Send,
F: Send,
impl<F> Sync for CompactProtocol<F> where
F: Sync,
F: Sync,
impl<F> Unpin for CompactProtocol<F> where
F: Unpin,
F: Unpin,
impl<F> UnwindSafe for CompactProtocol<F> where
F: UnwindSafe,
F: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,