pub trait BitEncode<Ctx = (), Tag = ()> {
// Required method
fn encode<W, E>(&self, write: &mut W, ctx: &mut Ctx, tag: Tag) -> Result<()>
where W: BitWrite,
E: Endianness;
}Expand description
A trait for bit-level encoding.
Required Methods§
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.
Implementations on Foreign Types§
Source§impl<'a, Ctx, Tag, T> BitEncode<Ctx, Tag> for Cow<'a, T>
Available on crate feature alloc only.
impl<'a, Ctx, Tag, T> BitEncode<Ctx, Tag> for Cow<'a, T>
Available on crate feature
alloc only.Source§impl<Ctx> BitEncode<Ctx> for PhantomPinned
impl<Ctx> BitEncode<Ctx> for PhantomPinned
Source§impl<Ctx> BitEncode<Ctx> for NonZeroI16
impl<Ctx> BitEncode<Ctx> for NonZeroI16
Source§impl<Ctx> BitEncode<Ctx> for NonZeroI32
impl<Ctx> BitEncode<Ctx> for NonZeroI32
Source§impl<Ctx> BitEncode<Ctx> for NonZeroI64
impl<Ctx> BitEncode<Ctx> for NonZeroI64
Source§impl<Ctx> BitEncode<Ctx> for NonZeroI128
impl<Ctx> BitEncode<Ctx> for NonZeroI128
Source§impl<Ctx> BitEncode<Ctx> for NonZeroIsize
Available on 64-bit only.
impl<Ctx> BitEncode<Ctx> for NonZeroIsize
Available on 64-bit only.
Source§impl<Ctx> BitEncode<Ctx> for NonZeroU16
impl<Ctx> BitEncode<Ctx> for NonZeroU16
Source§impl<Ctx> BitEncode<Ctx> for NonZeroU32
impl<Ctx> BitEncode<Ctx> for NonZeroU32
Source§impl<Ctx> BitEncode<Ctx> for NonZeroU64
impl<Ctx> BitEncode<Ctx> for NonZeroU64
Source§impl<Ctx> BitEncode<Ctx> for NonZeroU128
impl<Ctx> BitEncode<Ctx> for NonZeroU128
Source§impl<Ctx> BitEncode<Ctx> for NonZeroUsize
Available on 64-bit only.
impl<Ctx> BitEncode<Ctx> for NonZeroUsize
Available on 64-bit only.
Source§impl<Ctx, K, V> BitEncode<Ctx> for BTreeMap<K, V>
Available on crate features alloc and prepend-tags only.
impl<Ctx, K, V> BitEncode<Ctx> for BTreeMap<K, V>
Available on crate features
alloc and prepend-tags only.Source§impl<Ctx, K, V> BitEncode<Ctx, Untagged> for BTreeMap<K, V>
Available on crate feature alloc only.
impl<Ctx, K, V> BitEncode<Ctx, Untagged> for BTreeMap<K, V>
Available on crate feature
alloc only.Source§impl<Ctx, K, V, H> BitEncode<Ctx> for HashMap<K, V, H>
Available on crate features std and prepend-tags only.
impl<Ctx, K, V, H> BitEncode<Ctx> for HashMap<K, V, H>
Available on crate features
std and prepend-tags only.Source§impl<Ctx, K, V, H> BitEncode<Ctx, Untagged> for HashMap<K, V, H>
Available on crate feature std only.
impl<Ctx, K, V, H> BitEncode<Ctx, Untagged> for HashMap<K, V, H>
Available on crate feature
std only.Source§impl<Ctx, T> BitEncode<Ctx> for Option<T>where
T: BitEncode<Ctx>,
Available on crate feature prepend-tags only.
impl<Ctx, T> BitEncode<Ctx> for Option<T>where
T: BitEncode<Ctx>,
Available on crate feature
prepend-tags only.Source§impl<Ctx, T> BitEncode<Ctx> for [T]where
T: BitEncode<Ctx>,
Available on crate feature prepend-tags only.
impl<Ctx, T> BitEncode<Ctx> for [T]where
T: BitEncode<Ctx>,
Available on crate feature
prepend-tags only.Source§impl<Ctx, T> BitEncode<Ctx> for BinaryHeap<T>
Available on crate features alloc and prepend-tags only.
impl<Ctx, T> BitEncode<Ctx> for BinaryHeap<T>
Available on crate features
alloc and prepend-tags only.Source§impl<Ctx, T> BitEncode<Ctx> for BTreeSet<T>
Available on crate features alloc and prepend-tags only.
impl<Ctx, T> BitEncode<Ctx> for BTreeSet<T>
Available on crate features
alloc and prepend-tags only.Source§impl<Ctx, T> BitEncode<Ctx> for LinkedList<T>where
T: BitEncode<Ctx>,
Available on crate features alloc and prepend-tags only.
impl<Ctx, T> BitEncode<Ctx> for LinkedList<T>where
T: BitEncode<Ctx>,
Available on crate features
alloc and prepend-tags only.Source§impl<Ctx, T> BitEncode<Ctx> for VecDeque<T>where
T: BitEncode<Ctx>,
Available on crate features alloc and prepend-tags only.
impl<Ctx, T> BitEncode<Ctx> for VecDeque<T>where
T: BitEncode<Ctx>,
Available on crate features
alloc and prepend-tags only.Source§impl<Ctx, T> BitEncode<Ctx> for Vec<T>where
T: BitEncode<Ctx>,
Available on crate features alloc and prepend-tags only.
impl<Ctx, T> BitEncode<Ctx> for Vec<T>where
T: BitEncode<Ctx>,
Available on crate features
alloc and prepend-tags only.Source§impl<Ctx, T> BitEncode<Ctx> for PhantomData<T>
impl<Ctx, T> BitEncode<Ctx> for PhantomData<T>
Source§impl<Ctx, T> BitEncode<Ctx, Untagged> for BinaryHeap<T>
Available on crate feature alloc only.
impl<Ctx, T> BitEncode<Ctx, Untagged> for BinaryHeap<T>
Available on crate feature
alloc only.Source§impl<Ctx, T> BitEncode<Ctx, Untagged> for LinkedList<T>where
T: BitEncode<Ctx>,
Available on crate feature alloc only.
impl<Ctx, T> BitEncode<Ctx, Untagged> for LinkedList<T>where
T: BitEncode<Ctx>,
Available on crate feature
alloc only.Source§impl<Ctx, T> BitEncode<Ctx, Untagged> for VecDeque<T>where
T: BitEncode<Ctx>,
Available on crate feature alloc only.
impl<Ctx, T> BitEncode<Ctx, Untagged> for VecDeque<T>where
T: BitEncode<Ctx>,
Available on crate feature
alloc only.Source§impl<Ctx, T> BitEncode<Ctx, Untagged> for Vec<T>where
T: BitEncode<Ctx>,
Available on crate feature alloc only.
impl<Ctx, T> BitEncode<Ctx, Untagged> for Vec<T>where
T: BitEncode<Ctx>,
Available on crate feature
alloc only.Source§impl<Ctx, T, H> BitEncode<Ctx> for HashSet<T, H>
Available on crate features std and prepend-tags only.
impl<Ctx, T, H> BitEncode<Ctx> for HashSet<T, H>
Available on crate features
std and prepend-tags only.Source§impl<Ctx, T, H> BitEncode<Ctx, Untagged> for HashSet<T, H>
Available on crate feature std only.
impl<Ctx, T, H> BitEncode<Ctx, Untagged> for HashSet<T, H>
Available on crate feature
std only.Source§impl<Ctx, Tag, T> BitEncode<Ctx, Tag> for (T₁, T₂, …, Tₙ)where
T: BitEncode<Ctx, Tag>,
This trait is implemented for tuples with up to 16 items.
impl<Ctx, Tag, T> BitEncode<Ctx, Tag> for (T₁, T₂, …, Tₙ)where
T: BitEncode<Ctx, Tag>,
This trait is implemented for tuples with up to 16 items.