Struct fluvio_protocol_codec::FluvioCodec[][src]

pub struct FluvioCodec {}
Expand description

Implement Fluvio Encoding First 4 bytes are size of the message. Then total buffer = 4 + message content

Implementations

impl FluvioCodec[src]

pub fn new() -> Self[src]

Trait Implementations

impl Debug for FluvioCodec[src]

fn fmt(&self, f: &mut Formatter<'_>) -> Result[src]

Formats the value using the given formatter. Read more

impl Decoder for FluvioCodec[src]

type Item = BytesMut

The type of decoded frames.

type Error = IoError

The type of unrecoverable frame decoding errors. Read more

fn decode(
    &mut self,
    bytes: &mut BytesMut
) -> Result<Option<BytesMut>, Self::Error>
[src]

Attempts to decode a frame from the provided buffer of bytes. Read more

fn decode_eof(
    &mut self,
    buf: &mut BytesMut
) -> Result<Option<Self::Item>, Self::Error>
[src]

A default method available to be called when there are no more bytes available to be read from the underlying I/O. Read more

fn framed<T>(self, io: T) -> Framed<T, Self> where
    T: AsyncRead + AsyncWrite, 
[src]

Provides a Stream and Sink interface for reading and writing to this Io object, using Decode and Encode to read and write the raw data. Read more

impl Default for FluvioCodec[src]

fn default() -> FluvioCodec[src]

Returns the “default value” for a type. Read more

impl<T: FluvioEncoder> Encoder<(T, i16)> for FluvioCodec[src]

Implement encoder for Fluvio Codec

type Error = IoError

The type of encoding errors. Read more

fn encode(
    &mut self,
    src: (T, Version),
    buf: &mut BytesMut
) -> Result<(), IoError>
[src]

Encodes a frame into the buffer provided. Read more

impl Encoder<Bytes> for FluvioCodec[src]

Implement encoder for Fluvio Codec This is straight pass thru, actual encoding is done file slice

type Error = IoError

The type of encoding errors. Read more

fn encode(&mut self, data: Bytes, buf: &mut BytesMut) -> Result<(), IoError>[src]

Encodes a frame into the buffer provided. Read more

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

impl<T> From<T> for T[src]

pub fn from(t: T) -> T[src]

Performs the conversion.

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

pub fn into(self) -> U[src]

Performs the conversion.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]

Performs the conversion.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]

Performs the conversion.