Struct serde_cbor::Deserializer [−][src]
A Serde Deserialize
r of CBOR data.
Implementations
impl<R> Deserializer<IoRead<R>> where
R: Read,
[src]
R: Read,
pub fn from_reader(reader: R) -> Deserializer<IoRead<R>>
[src]
Constructs a Deserializer
which reads from a Read
er.
impl<'a> Deserializer<SliceRead<'a>>
[src]
pub fn from_slice(bytes: &'a [u8]) -> Deserializer<SliceRead<'a>>
[src]
Constructs a Deserializer
which reads from a slice.
Borrowed strings and byte slices will be provided when possible.
impl<'a> Deserializer<MutSliceRead<'a>>
[src]
pub fn from_mut_slice(bytes: &'a mut [u8]) -> Deserializer<MutSliceRead<'a>>
[src]
Constructs a Deserializer
which reads from a mutable slice that doubles as its own
scratch buffer.
Borrowed strings and byte slices will be provided even for indefinite strings.
impl<'de, R> Deserializer<R> where
R: Read<'de>,
[src]
R: Read<'de>,
pub fn new(read: R) -> Self
[src]
Constructs a Deserializer
from one of the possible serde_cbor input sources.
from_slice
and from_reader
should normally be used instead of this method.
pub fn disable_named_format(self) -> Self
[src]
Don’t accept named variants and fields.
pub fn disable_packed_format(self) -> Self
[src]
Don’t accept numbered variants and fields.
pub fn disable_standard_enums(self) -> Self
[src]
Don’t accept the new enum format used by serde_cbor
versions >= v0.10.
pub fn disable_legacy_enums(self) -> Self
[src]
Don’t accept the old enum format used by serde_cbor
versions <= v0.9.
pub fn end(&mut self) -> Result<()>
[src]
This method should be called after a value has been deserialized to ensure there is no trailing data in the input source.
pub fn into_iter<T>(self) -> StreamDeserializer<'de, R, T>ⓘNotable traits for StreamDeserializer<'de, R, T>
impl<'de, R, T> Iterator for StreamDeserializer<'de, R, T> where
R: Read<'de>,
T: Deserialize<'de>, type Item = Result<T>;
where
T: Deserialize<'de>,
[src]
Notable traits for StreamDeserializer<'de, R, T>
impl<'de, R, T> Iterator for StreamDeserializer<'de, R, T> where
R: Read<'de>,
T: Deserialize<'de>, type Item = Result<T>;
T: Deserialize<'de>,
Turn a CBOR deserializer into an iterator over values of type T.
impl<R> Deserializer<R> where
R: Offset,
[src]
R: Offset,
pub fn byte_offset(&self) -> usize
[src]
Return the current offset in the reader
Trait Implementations
impl<R: Debug> Debug for Deserializer<R>
[src]
impl<'de, 'a, R> Deserializer<'de> for &'a mut Deserializer<R> where
R: Read<'de>,
[src]
R: Read<'de>,
type Error = Error
The error type that can be returned if some error occurs during deserialization. Read more
fn deserialize_any<V>(self, visitor: V) -> Result<V::Value> where
V: Visitor<'de>,
[src]
V: Visitor<'de>,
fn deserialize_option<V>(self, visitor: V) -> Result<V::Value> where
V: Visitor<'de>,
[src]
V: Visitor<'de>,
fn deserialize_newtype_struct<V>(
self,
_name: &str,
visitor: V
) -> Result<V::Value> where
V: Visitor<'de>,
[src]
self,
_name: &str,
visitor: V
) -> Result<V::Value> where
V: Visitor<'de>,
fn deserialize_enum<V>(
self,
_name: &str,
_variants: &'static [&'static str],
visitor: V
) -> Result<V::Value> where
V: Visitor<'de>,
[src]
self,
_name: &str,
_variants: &'static [&'static str],
visitor: V
) -> Result<V::Value> where
V: Visitor<'de>,
fn is_human_readable(&self) -> bool
[src]
fn deserialize_bool<V>(self, visitor: V) -> Result<V::Value, Self::Error> where
V: Visitor<'de>,
[src]
V: Visitor<'de>,
fn deserialize_i8<V>(self, visitor: V) -> Result<V::Value, Self::Error> where
V: Visitor<'de>,
[src]
V: Visitor<'de>,
fn deserialize_i16<V>(self, visitor: V) -> Result<V::Value, Self::Error> where
V: Visitor<'de>,
[src]
V: Visitor<'de>,
fn deserialize_i32<V>(self, visitor: V) -> Result<V::Value, Self::Error> where
V: Visitor<'de>,
[src]
V: Visitor<'de>,
fn deserialize_i64<V>(self, visitor: V) -> Result<V::Value, Self::Error> where
V: Visitor<'de>,
[src]
V: Visitor<'de>,
fn deserialize_i128<V>(self, visitor: V) -> Result<V::Value, Self::Error> where
V: Visitor<'de>,
[src]
V: Visitor<'de>,
fn deserialize_u8<V>(self, visitor: V) -> Result<V::Value, Self::Error> where
V: Visitor<'de>,
[src]
V: Visitor<'de>,
fn deserialize_u16<V>(self, visitor: V) -> Result<V::Value, Self::Error> where
V: Visitor<'de>,
[src]
V: Visitor<'de>,
fn deserialize_u32<V>(self, visitor: V) -> Result<V::Value, Self::Error> where
V: Visitor<'de>,
[src]
V: Visitor<'de>,
fn deserialize_u64<V>(self, visitor: V) -> Result<V::Value, Self::Error> where
V: Visitor<'de>,
[src]
V: Visitor<'de>,
fn deserialize_u128<V>(self, visitor: V) -> Result<V::Value, Self::Error> where
V: Visitor<'de>,
[src]
V: Visitor<'de>,
fn deserialize_f32<V>(self, visitor: V) -> Result<V::Value, Self::Error> where
V: Visitor<'de>,
[src]
V: Visitor<'de>,
fn deserialize_f64<V>(self, visitor: V) -> Result<V::Value, Self::Error> where
V: Visitor<'de>,
[src]
V: Visitor<'de>,
fn deserialize_char<V>(self, visitor: V) -> Result<V::Value, Self::Error> where
V: Visitor<'de>,
[src]
V: Visitor<'de>,
fn deserialize_str<V>(self, visitor: V) -> Result<V::Value, Self::Error> where
V: Visitor<'de>,
[src]
V: Visitor<'de>,
fn deserialize_string<V>(self, visitor: V) -> Result<V::Value, Self::Error> where
V: Visitor<'de>,
[src]
V: Visitor<'de>,
fn deserialize_unit<V>(self, visitor: V) -> Result<V::Value, Self::Error> where
V: Visitor<'de>,
[src]
V: Visitor<'de>,
fn deserialize_unit_struct<V>(
self,
name: &'static str,
visitor: V
) -> Result<V::Value, Self::Error> where
V: Visitor<'de>,
[src]
self,
name: &'static str,
visitor: V
) -> Result<V::Value, Self::Error> where
V: Visitor<'de>,
fn deserialize_seq<V>(self, visitor: V) -> Result<V::Value, Self::Error> where
V: Visitor<'de>,
[src]
V: Visitor<'de>,
fn deserialize_tuple<V>(
self,
len: usize,
visitor: V
) -> Result<V::Value, Self::Error> where
V: Visitor<'de>,
[src]
self,
len: usize,
visitor: V
) -> Result<V::Value, Self::Error> where
V: Visitor<'de>,
fn deserialize_tuple_struct<V>(
self,
name: &'static str,
len: usize,
visitor: V
) -> Result<V::Value, Self::Error> where
V: Visitor<'de>,
[src]
self,
name: &'static str,
len: usize,
visitor: V
) -> Result<V::Value, Self::Error> where
V: Visitor<'de>,
fn deserialize_map<V>(self, visitor: V) -> Result<V::Value, Self::Error> where
V: Visitor<'de>,
[src]
V: Visitor<'de>,
fn deserialize_struct<V>(
self,
name: &'static str,
fields: &'static [&'static str],
visitor: V
) -> Result<V::Value, Self::Error> where
V: Visitor<'de>,
[src]
self,
name: &'static str,
fields: &'static [&'static str],
visitor: V
) -> Result<V::Value, Self::Error> where
V: Visitor<'de>,
fn deserialize_identifier<V>(self, visitor: V) -> Result<V::Value, Self::Error> where
V: Visitor<'de>,
[src]
V: Visitor<'de>,
fn deserialize_ignored_any<V>(self, visitor: V) -> Result<V::Value, Self::Error> where
V: Visitor<'de>,
[src]
V: Visitor<'de>,
fn deserialize_bytes<V>(self, visitor: V) -> Result<V::Value, Self::Error> where
V: Visitor<'de>,
[src]
V: Visitor<'de>,
fn deserialize_byte_buf<V>(self, visitor: V) -> Result<V::Value, Self::Error> where
V: Visitor<'de>,
[src]
V: Visitor<'de>,
Auto Trait Implementations
impl<R> RefUnwindSafe for Deserializer<R> where
R: RefUnwindSafe,
R: RefUnwindSafe,
impl<R> Send for Deserializer<R> where
R: Send,
R: Send,
impl<R> Sync for Deserializer<R> where
R: Sync,
R: Sync,
impl<R> Unpin for Deserializer<R> where
R: Unpin,
R: Unpin,
impl<R> UnwindSafe for Deserializer<R> where
R: UnwindSafe,
R: 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,
pub 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, 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.
pub 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>,