Enum nachricht::Header [−][src]
Variants
Also known as unit or nil
The boolean value true
The boolean value false
The following four bytes contain an IEEE-754 32-bit floating point number
The following eight bytes contain an IEEE-754 64-bit floating point number
Bin(usize)
The value describes the length of a following byte array. Note that this code also contains the five fixed length values.
Pos(u64)
The value describes a postive integer fitting into an u64
Neg(u64)
The value describes a negative integer whose negative fits into an u64
Bag(usize)
The value describes the length in fields of a container. the fields follow the header immediately.
Str(usize)
The value describes the length in bytes of a following unicode string
Sym(usize)
A symbol has the same semantics as a string except that it gets pushed into the symbol table and can be referenced from there
Key(usize)
The value describes the length in bytes of a following key value. This in itself does not define a field and thus has to immediately followed by another header whose field will be named by this key.
Ref(usize)
A reference into the symbol table. This could resolve to either a symbol (which itself resolve to a string) or a key.
Implementations
impl Header
[src]
pub fn name(&self) -> &'static str
[src]
Returns the mnemonic of the header. This is useful for error messages.
pub fn encode<W: Write>(&self, w: &mut W) -> Result<usize, EncodeError>
[src]
Returns the number of written bytes
pub fn decode<B: ?Sized + AsRef<[u8]>>(
buf: &B
) -> Result<(Self, usize), DecodeError>
[src]
buf: &B
) -> Result<(Self, usize), DecodeError>
Returns the decoded header and the number of consumed bytes
Trait Implementations
impl Clone for Header
[src]
impl Copy for Header
[src]
impl Debug for Header
[src]
impl PartialEq<Header> for Header
[src]
impl StructuralPartialEq for Header
[src]
Auto Trait Implementations
impl RefUnwindSafe for Header
[src]
impl Send for Header
[src]
impl Sync for Header
[src]
impl Unpin for Header
[src]
impl UnwindSafe for Header
[src]
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> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
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>,