Struct bin_layout::Record
source · [−]pub struct Record<Len: FixedLenInt, T> {
pub data: T,
/* private fields */
}Expand description
Record can be used to represent fixed-size integer to represent the length of a record.
It accepts fixed-length unsigned interger type of N (u8, u32, usize, etc..) and a generic type of T (Vec<T>, String etc..)
Example
use bin_layout::{Record, Encoder};
let record: Record<u8, &str> = "HelloWorld".into();
assert_eq!(record.len(), 10);
let bytes = record.encode();
assert_eq!(bytes.len(), 11);Fields
data: TImplementations
sourceimpl<N: FixedLenInt, T> Record<N, T>
impl<N: FixedLenInt, T> Record<N, T>
Trait Implementations
sourceimpl<N: FixedLenInt, T: Debug> Debug for Record<N, T>
impl<N: FixedLenInt, T: Debug> Debug for Record<N, T>
sourceimpl<'de, E: Error, Len> Decoder<'de, E> for Record<Len, &'de [u8]> where
usize: TryFrom<Len>,
Len: FixedLenInt + Decoder<'de, E>,
impl<'de, E: Error, Len> Decoder<'de, E> for Record<Len, &'de [u8]> where
usize: TryFrom<Len>,
Len: FixedLenInt + Decoder<'de, E>,
sourceimpl<'de, E: Error, Len> Decoder<'de, E> for Record<Len, &'de str> where
usize: TryFrom<Len>,
Len: FixedLenInt + Decoder<'de, E>,
impl<'de, E: Error, Len> Decoder<'de, E> for Record<Len, &'de str> where
usize: TryFrom<Len>,
Len: FixedLenInt + Decoder<'de, E>,
sourceimpl<'de, E: Error, Len> Decoder<'de, E> for Record<Len, String> where
usize: TryFrom<Len>,
Len: FixedLenInt + Decoder<'de, E>,
impl<'de, E: Error, Len> Decoder<'de, E> for Record<Len, String> where
usize: TryFrom<Len>,
Len: FixedLenInt + Decoder<'de, E>,
sourceimpl<'de, E: Error, Len, T> Decoder<'de, E> for Record<Len, Vec<T>> where
T: Decoder<'de, E>,
usize: TryFrom<Len>,
Len: Decoder<'de, E> + FixedLenInt,
impl<'de, E: Error, Len, T> Decoder<'de, E> for Record<Len, Vec<T>> where
T: Decoder<'de, E>,
usize: TryFrom<Len>,
Len: Decoder<'de, E> + FixedLenInt,
sourceimpl<N: FixedLenInt, T> Deref for Record<N, T>
impl<N: FixedLenInt, T> Deref for Record<N, T>
sourceimpl<N: FixedLenInt, T> DerefMut for Record<N, T>
impl<N: FixedLenInt, T> DerefMut for Record<N, T>
sourceimpl<N: FixedLenInt, T> From<T> for Record<N, T>
impl<N: FixedLenInt, T> From<T> for Record<N, T>
sourceimpl<Len: Ord + FixedLenInt, T: Ord> Ord for Record<Len, T>
impl<Len: Ord + FixedLenInt, T: Ord> Ord for Record<Len, T>
sourceimpl<Len: PartialOrd + FixedLenInt, T: PartialOrd> PartialOrd<Record<Len, T>> for Record<Len, T>
impl<Len: PartialOrd + FixedLenInt, T: PartialOrd> PartialOrd<Record<Len, T>> for Record<Len, T>
sourcefn partial_cmp(&self, other: &Record<Len, T>) -> Option<Ordering>
fn partial_cmp(&self, other: &Record<Len, T>) -> Option<Ordering>
This method returns an ordering between self and other values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for self and other) and is used by the <=
operator. Read more
impl<Len: Eq + FixedLenInt, T: Eq> Eq for Record<Len, T>
impl<Len: FixedLenInt, T> StructuralEq for Record<Len, T>
impl<Len: FixedLenInt, T> StructuralPartialEq for Record<Len, T>
Auto Trait Implementations
impl<Len, T> RefUnwindSafe for Record<Len, T> where
Len: RefUnwindSafe,
T: RefUnwindSafe,
impl<Len, T> Send for Record<Len, T> where
Len: Send,
T: Send,
impl<Len, T> Sync for Record<Len, T> where
Len: Sync,
T: Sync,
impl<Len, T> Unpin for Record<Len, T> where
Len: Unpin,
T: Unpin,
impl<Len, T> UnwindSafe for Record<Len, T> where
Len: UnwindSafe,
T: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
🔬 This is a nightly-only experimental API. (
toowned_clone_into)Uses borrowed data to replace owned data, usually by cloning. Read more