Struct SimpleJsonProtocolDeserializer

Source
pub struct SimpleJsonProtocolDeserializer<B> { /* private fields */ }

Implementations§

Source§

impl<B: Buf> SimpleJsonProtocolDeserializer<B>

Source

pub fn new(buffer: B) -> Self

Source

pub fn into_inner(self) -> B

Source

pub fn peek(&self) -> Option<u8>

Returns a byte from the underly buffer if there is enough remaining

Trait Implementations§

Source§

impl<B: Buf> Deserialize<SimpleJsonProtocolDeserializer<B>> for Value

Source§

impl<B: Buf> ProtocolReader for SimpleJsonProtocolDeserializer<B>

Source§

fn skip(&mut self, field_type: TType) -> Result<()>

Override the default skip impl to handle random JSON noise

Source§

fn read_message_begin<F, T>( &mut self, _msgfn: F, ) -> Result<(T, MessageType, u32)>
where F: FnOnce(&[u8]) -> T,

Source§

fn read_message_end(&mut self) -> Result<()>

Source§

fn read_struct_begin<F, T>(&mut self, namefn: F) -> Result<T>
where F: FnOnce(&[u8]) -> T,

Source§

fn read_struct_end(&mut self) -> Result<()>

Source§

fn read_field_begin<F, T>( &mut self, fieldfn: F, fields: &[Field], ) -> Result<(T, TType, i16)>
where F: FnOnce(&[u8]) -> T,

Source§

fn read_field_end(&mut self) -> Result<()>

Source§

fn read_map_begin(&mut self) -> Result<(TType, TType, Option<usize>)>

Source§

fn read_map_key_begin(&mut self) -> Result<bool>

Source§

fn read_map_value_begin(&mut self) -> Result<()>

Source§

fn read_map_value_end(&mut self) -> Result<()>

Source§

fn read_map_end(&mut self) -> Result<()>

Source§

fn read_list_begin(&mut self) -> Result<(TType, Option<usize>)>

Source§

fn read_list_value_begin(&mut self) -> Result<bool>

Source§

fn read_list_value_end(&mut self) -> Result<()>

Source§

fn read_list_end(&mut self) -> Result<()>

Source§

fn read_set_begin(&mut self) -> Result<(TType, Option<usize>)>

Source§

fn read_set_value_begin(&mut self) -> Result<bool>

Source§

fn read_set_value_end(&mut self) -> Result<()>

Source§

fn read_set_end(&mut self) -> Result<()>

Source§

fn read_bool(&mut self) -> Result<bool>

Source§

fn read_byte(&mut self) -> Result<i8>

Source§

fn read_i16(&mut self) -> Result<i16>

Source§

fn read_i32(&mut self) -> Result<i32>

Source§

fn read_i64(&mut self) -> Result<i64>

Source§

fn read_double(&mut self) -> Result<f64>

Source§

fn read_float(&mut self) -> Result<f32>

Source§

fn read_string(&mut self) -> Result<String>

Source§

fn read_binary<V: CopyFromBuf>(&mut self) -> Result<V>

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

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

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

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

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

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

Performs the conversion.