Struct Tag

Source
pub struct Tag<T>(pub T);
Expand description

A marker for BitDecode implementors that require a tag.

Tuple Fields§

§0: T

Trait Implementations§

Source§

impl<Tag, Ctx, K, V> BitDecode<Ctx, Tag<Tag>> for BTreeMap<K, V>
where K: BitDecode<Ctx> + Ord, V: BitDecode<Ctx>, Tag: TryInto<usize>,

Source§

fn decode<R, E>(read: &mut R, ctx: &mut Ctx, tag: Tag<Tag>) -> Result<Self>
where R: BitRead, E: Endianness,

Reads self from a stream.
Source§

fn decode_bytes_ctx<E>( bytes: &[u8], byte_order: E, ctx: &mut Ctx, tag: Tag, ) -> Result<Self>
where E: Endianness,

Parses a new value from its raw byte representation with provided context and tag.
Source§

impl<Tag, Ctx, T> BitDecode<Ctx, Tag<Tag>> for BTreeSet<T>
where T: BitDecode<Ctx> + Ord, Tag: TryInto<usize>,

Source§

fn decode<R, E>(read: &mut R, ctx: &mut Ctx, tag: Tag<Tag>) -> Result<Self>
where R: BitRead, E: Endianness,

Reads self from a stream.
Source§

fn decode_bytes_ctx<E>( bytes: &[u8], byte_order: E, ctx: &mut Ctx, tag: Tag, ) -> Result<Self>
where E: Endianness,

Parses a new value from its raw byte representation with provided context and tag.
Source§

impl<Tag, Ctx, T> BitDecode<Ctx, Tag<Tag>> for BinaryHeap<T>
where T: BitDecode<Ctx> + Ord, Tag: TryInto<usize>,

Source§

fn decode<R, E>(read: &mut R, ctx: &mut Ctx, tag: Tag<Tag>) -> Result<Self>
where R: BitRead, E: Endianness,

Reads self from a stream.
Source§

fn decode_bytes_ctx<E>( bytes: &[u8], byte_order: E, ctx: &mut Ctx, tag: Tag, ) -> Result<Self>
where E: Endianness,

Parses a new value from its raw byte representation with provided context and tag.
Source§

impl<Tag, Ctx, K, V, H> BitDecode<Ctx, Tag<Tag>> for HashMap<K, V, H>
where K: BitDecode<Ctx> + Eq + Hash, V: BitDecode<Ctx>, Tag: TryInto<usize>, H: BuildHasher + Default,

Source§

fn decode<R, E>(read: &mut R, ctx: &mut Ctx, tag: Tag<Tag>) -> Result<Self>
where R: BitRead, E: Endianness,

Reads self from a stream.
Source§

fn decode_bytes_ctx<E>( bytes: &[u8], byte_order: E, ctx: &mut Ctx, tag: Tag, ) -> Result<Self>
where E: Endianness,

Parses a new value from its raw byte representation with provided context and tag.
Source§

impl<Tag, Ctx, T, H> BitDecode<Ctx, Tag<Tag>> for HashSet<T, H>
where T: BitDecode<Ctx> + Hash + Eq, Tag: TryInto<usize>, H: BuildHasher + Default,

Source§

fn decode<R, E>(read: &mut R, ctx: &mut Ctx, tag: Tag<Tag>) -> Result<Self>
where R: BitRead, E: Endianness,

Reads self from a stream.
Source§

fn decode_bytes_ctx<E>( bytes: &[u8], byte_order: E, ctx: &mut Ctx, tag: Tag, ) -> Result<Self>
where E: Endianness,

Parses a new value from its raw byte representation with provided context and tag.
Source§

impl<Tag, Ctx, T> BitDecode<Ctx, Tag<Tag>> for LinkedList<T>
where T: BitDecode<Ctx>, Tag: TryInto<usize>,

Source§

fn decode<R, E>(read: &mut R, ctx: &mut Ctx, tag: Tag<Tag>) -> Result<Self>
where R: BitRead, E: Endianness,

Reads self from a stream.
Source§

fn decode_bytes_ctx<E>( bytes: &[u8], byte_order: E, ctx: &mut Ctx, tag: Tag, ) -> Result<Self>
where E: Endianness,

Parses a new value from its raw byte representation with provided context and tag.
Source§

impl<Tag, Ctx, T> BitDecode<Ctx, Tag<Tag>> for Option<T>
where T: BitDecode<Ctx>, Tag: TryInto<bool>,

Source§

fn decode<R, E>(read: &mut R, ctx: &mut Ctx, tag: Tag<Tag>) -> Result<Self>
where R: BitRead, E: Endianness,

Reads self from a stream.
Source§

fn decode_bytes_ctx<E>( bytes: &[u8], byte_order: E, ctx: &mut Ctx, tag: Tag, ) -> Result<Self>
where E: Endianness,

Parses a new value from its raw byte representation with provided context and tag.
Source§

impl<Tag, Ctx> BitDecode<Ctx, Tag<Tag>> for String
where Tag: TryInto<usize>,

Source§

fn decode<R, E>(read: &mut R, ctx: &mut Ctx, tag: Tag<Tag>) -> Result<Self>
where R: BitRead, E: Endianness,

Reads self from a stream.
Source§

fn decode_bytes_ctx<E>( bytes: &[u8], byte_order: E, ctx: &mut Ctx, tag: Tag, ) -> Result<Self>
where E: Endianness,

Parses a new value from its raw byte representation with provided context and tag.
Source§

impl<Tag, Ctx, T> BitDecode<Ctx, Tag<Tag>> for Vec<T>
where T: BitDecode<Ctx>, Tag: TryInto<usize>,

Source§

fn decode<R, E>(read: &mut R, ctx: &mut Ctx, tag: Tag<Tag>) -> Result<Self>
where R: BitRead, E: Endianness,

Reads self from a stream.
Source§

fn decode_bytes_ctx<E>( bytes: &[u8], byte_order: E, ctx: &mut Ctx, tag: Tag, ) -> Result<Self>
where E: Endianness,

Parses a new value from its raw byte representation with provided context and tag.
Source§

impl<Tag, Ctx, T> BitDecode<Ctx, Tag<Tag>> for VecDeque<T>
where T: BitDecode<Ctx>, Tag: TryInto<usize>,

Source§

fn decode<R, E>(read: &mut R, ctx: &mut Ctx, tag: Tag<Tag>) -> Result<Self>
where R: BitRead, E: Endianness,

Reads self from a stream.
Source§

fn decode_bytes_ctx<E>( bytes: &[u8], byte_order: E, ctx: &mut Ctx, tag: Tag, ) -> Result<Self>
where E: Endianness,

Parses a new value from its raw byte representation with provided context and tag.

Auto Trait Implementations§

§

impl<T> Freeze for Tag<T>
where T: Freeze,

§

impl<T> RefUnwindSafe for Tag<T>
where T: RefUnwindSafe,

§

impl<T> Send for Tag<T>
where T: Send,

§

impl<T> Sync for Tag<T>
where T: Sync,

§

impl<T> Unpin for Tag<T>
where T: Unpin,

§

impl<T> UnwindSafe for Tag<T>
where T: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.