Enum fourleaf::unknown::UnknownField
[−]
[src]
pub enum UnknownField<'a> { Integer(u64), Blob(Cow<'a, [u8]>), Struct(UnknownFields<'a>), Enum(u64, UnknownFields<'a>), }
A single field of arbitrary type.
This is not intended to be particularly easy use; it mainly exists as a
storage mechanism for UnknownFields
.
Variants
Integer(u64)
An integer value.
There is no way to tell what the integer actually represents, whether it is signed (with ZigZag) or unsigned, etc.
Blob(Cow<'a, [u8]>)
A binary blob.
Struct(UnknownFields<'a>)
A child structure.
Enum(u64, UnknownFields<'a>)
A child enum with the given discriminant.
Trait Implementations
impl<'a> Debug for UnknownField<'a>
[src]
impl<'a> Clone for UnknownField<'a>
[src]
fn clone(&self) -> UnknownField<'a>
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more
impl<'a> PartialEq for UnknownField<'a>
[src]
fn eq(&self, __arg_0: &UnknownField<'a>) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &UnknownField<'a>) -> bool
This method tests for !=
.
impl<'a> Eq for UnknownField<'a>
[src]
impl<'a> Serialize for UnknownField<'a>
[src]
fn serialize_element<R: Write>(
&self,
dst: &mut Stream<R>,
tag: u8
) -> Result<()>
&self,
dst: &mut Stream<R>,
tag: u8
) -> Result<()>
Serialises this value, which is an element of a collection, to the given stream. Read more
fn serialize_body<R: Write>(&self, dst: &mut Stream<R>) -> Result<()>
Serialises this value, which is at top-level or the tail part of a struct. Read more
fn serialize_field<R: Write>(&self, dst: &mut Stream<R>, tag: u8) -> Result<()>
Serialises this value, which is a field of a struct, to the given stream. Read more
fn serialize_slice<R: Write>(
selves: &[Self],
dst: &mut Stream<R>,
tag: u8
) -> Option<Result<()>> where
Self: Sized,
selves: &[Self],
dst: &mut Stream<R>,
tag: u8
) -> Option<Result<()>> where
Self: Sized,
If slices of this type should be written specially, do so and return Some
result. Otherwise, return None
. Read more
impl<'a, R: Read, STYLE> Deserialize<R, STYLE> for UnknownField<'a> where
Cow<'a, [u8]>: Deserialize<R, STYLE>,
[src]
Cow<'a, [u8]>: Deserialize<R, STYLE>,
type Accum = Option<Self>
Type used to accumulate the deserialised value of this field. Read more
fn deserialize_field(
accum: &mut Option<Self>,
context: &Context,
field: &mut Field<R>
) -> Result<()>
accum: &mut Option<Self>,
context: &Context,
field: &mut Field<R>
) -> Result<()>
Deserialises this type from a field in a container. Read more
fn finish(accum: Option<Self>, context: &Context) -> Result<Self>
Convert an accumulated value to a value of this type. Read more
fn deserialize_body(context: &Context, stream: &mut Stream<R>) -> Result<Self>
Deserialises this type from a top-level stream or from the tail portion of a struct. If this call succeeds, all field elements up to and including the closing EndOfStruct
element are consumed. Read more
fn deserialize_element(context: &Context, field: &mut Field<R>) -> Result<Self>
Deserialises this type from a single field entry, which is known to be the only occurrence that would constitute this value. Read more
fn serialized_as_slice() -> bool
Returns whether deserialize_vec
and the deserialize_array_*
methods return non-None. Read more
fn deserialize_vec(
context: &Context,
field: &mut Field<R>
) -> Option<Result<Vec<Self>>>
context: &Context,
field: &mut Field<R>
) -> Option<Result<Vec<Self>>>
If this type's Serialize
implementation has special behaviour in serialize_slice
, perform the reverse operation here and return a Vec
of values. Read more
fn deserialize_slice(
dst: &mut [Self],
context: &Context,
field: &mut Field<R>
) -> Option<Result<()>>
dst: &mut [Self],
context: &Context,
field: &mut Field<R>
) -> Option<Result<()>>
If this type's Serialize
implementation has special behaviour in serialize_slice
, perform the reverse operation here and write into the given slice of values, or return Err
if the slice is not the appropriate length. Read more
fn deserialize_array_0(
context: &Context,
field: &mut Field<R>
) -> Option<Result<[Self; 0]>>
context: &Context,
field: &mut Field<R>
) -> Option<Result<[Self; 0]>>
If this type's Serialize
implementation has special behaviour in serialize_slice
, perform the reverse operation here return an array of the given length, or return an error if the actual number of values is different from the length of the array. Read more