pub struct Bytes<const N: usize>;Expand description
A borrowed fixed-width span of wire bytes with no content interpretation.
N must be nonzero. Using Bytes<0> as a FixedCodec fails during constant
evaluation rather than exposing a codec that violates FixedCodec::WIDTH.
ⓘ
use wire_repr::{Bytes, FixedCodec};
let _ = <Bytes<0> as FixedCodec>::WIDTH;Bytes<N> decodes to the exact borrowed wire slice and plans an equally borrowed input
slice for copying at write time. It does not validate magic values, reserved bytes, or
any other domain semantics; consumers own those policies.
Trait Implementations§
impl<const N: usize> Copy for Bytes<N>
impl<const N: usize> Eq for Bytes<N>
Source§impl<const N: usize> FixedCodec for Bytes<N>
impl<const N: usize> FixedCodec for Bytes<N>
Source§type Value<'wire> = &'wire [u8]
where
Self: 'wire
type Value<'wire> = &'wire [u8] where Self: 'wire
Semantic value represented by an exact-width wire representation.
Source§type EncodeError = ExactWidthError
type EncodeError = ExactWidthError
Error returned while preparing an encoded value.
impl<const N: usize> StructuralPartialEq for Bytes<N>
Auto Trait Implementations§
impl<const N: usize> Freeze for Bytes<N>
impl<const N: usize> RefUnwindSafe for Bytes<N>
impl<const N: usize> Send for Bytes<N>
impl<const N: usize> Sync for Bytes<N>
impl<const N: usize> Unpin for Bytes<N>
impl<const N: usize> UnsafeUnpin for Bytes<N>
impl<const N: usize> UnwindSafe for Bytes<N>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more