Struct fourleaf::unknown::UnknownFields [] [src]

pub struct UnknownFields<'a>(pub Vec<(u8, UnknownField<'a>)>);

Stores a sequence of tags and the field values associated with them.

This is most useful in conjunction with the (?) pseudo-tag of a structure definition, as this will result in all unknown fields being preserved after deserialisation and being replicated on serialisation.

Note that this won't be a 100% perfect replica, since all unknown fields in the reserialisation will be grouped together even if they were not in the original.

Beware that this cannot be used as a tagged field of a struct-like composite, since its serialised format must use the tags it stores rather than the tag of its container. Attempting to serialise such an UnknownFields instance will result in a panic! If you really want to pass this around in a structure field, wrapping this in a 1-element array (i.e., [UnknownFields<'a>;1]) will work.

Trait Implementations

impl<'a> Debug for UnknownFields<'a>
[src]

Formats the value using the given formatter.

impl<'a> Clone for UnknownFields<'a>
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl<'a> PartialEq for UnknownFields<'a>
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

impl<'a> Eq for UnknownFields<'a>
[src]

impl<'a> Default for UnknownFields<'a>
[src]

Returns the "default value" for a type. Read more

impl<'a> Serialize for UnknownFields<'a>
[src]

Serialises this value, which is at top-level or the tail part of a struct. Read more

Serialises this value, which is an element of a collection, to the given stream. Read more

Serialises this value, which is a field of a struct, to the given stream. Read more

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 UnknownFields<'a> where
    Cow<'a, [u8]>: Deserialize<R, STYLE>, 
[src]

Type used to accumulate the deserialised value of this field. Read more

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

Deserialises this type from a field in a container. Read more

Deserialises this type from a single field entry, which is known to be the only occurrence that would constitute this value. Read more

Convert an accumulated value to a value of this type. Read more

Returns whether deserialize_vec and the deserialize_array_* methods return non-None. Read more

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

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

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