Struct bytecodec::value::DecodedValue [] [src]

pub struct DecodedValue<T>(_);

DecodedValue represents an already decoded item.

It does not consume any bytes, and returns the given item when decode() was first called.

Examples

use bytecodec::{Decode, Eos};
use bytecodec::value::DecodedValue;

let mut decoder = DecodedValue::new(10);

let (size, item) = decoder.decode(b"foo", Eos::new(false)).unwrap();
assert_eq!(item, Some(10));
assert_eq!(size, 0);

Methods

impl<T> DecodedValue<T>
[src]

[src]

Makes a new DecodedValue instance.

Trait Implementations

impl<T: Debug> Debug for DecodedValue<T>
[src]

[src]

Formats the value using the given formatter. Read more

impl<T> Decode for DecodedValue<T>
[src]

The type of items to be decoded.

[src]

Consumes the given buffer (a part of a byte sequence), and decodes an item from it. Read more

[src]

Returns the lower bound of the number of bytes needed to decode the next item. Read more

Auto Trait Implementations

impl<T> Send for DecodedValue<T> where
    T: Send

impl<T> Sync for DecodedValue<T> where
    T: Sync