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;
// Provided method
fn encode_bytes_ctx<E>(
&self,
byte_order: E,
ctx: &mut Ctx,
tag: Tag,
) -> Result<Vec<u8>>
where E: Endianness { ... }
}
Expand description
A trait for bit-level encoding.
Required Methods§
Provided Methods§
Sourcefn encode_bytes_ctx<E>(
&self,
byte_order: E,
ctx: &mut Ctx,
tag: Tag,
) -> Result<Vec<u8>>where
E: Endianness,
fn encode_bytes_ctx<E>(
&self,
byte_order: E,
ctx: &mut Ctx,
tag: Tag,
) -> Result<Vec<u8>>where
E: Endianness,
Gets the raw bytes of this type with provided context and tag.
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<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
impl<Ctx> BitEncode<Ctx> for NonZeroIsize
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
impl<Ctx> BitEncode<Ctx> for NonZeroUsize
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>
impl<Ctx, T> BitEncode<Ctx, Untagged> for BinaryHeap<T>
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.
Source§impl<Ctx, Tag, T> BitEncode<Ctx, Tag> for Saturating<T>where
T: BitEncode<Ctx, Tag>,
impl<Ctx, Tag, T> BitEncode<Ctx, Tag> for Saturating<T>where
T: BitEncode<Ctx, Tag>,
Source§impl<Ctx, Tag, T> BitEncode<Ctx, Tag> for Mutex<T>where
T: BitEncode<Ctx, Tag>,
Available on crate feature std
only.
impl<Ctx, Tag, T> BitEncode<Ctx, Tag> for Mutex<T>where
T: BitEncode<Ctx, Tag>,
Available on crate feature
std
only.Source§impl<Ctx, Tag, T> BitEncode<Ctx, Tag> for RwLock<T>where
T: BitEncode<Ctx, Tag>,
Available on crate feature std
only.
impl<Ctx, Tag, T> BitEncode<Ctx, Tag> for RwLock<T>where
T: BitEncode<Ctx, Tag>,
Available on crate feature
std
only.