pub struct U14(/* private fields */);
Expand description
A combination of 2 data bytes that holds 14 bits of information.
Implementations§
Source§impl U14
impl U14
Sourcepub unsafe fn from_unchecked(data: u16) -> U14
pub unsafe fn from_unchecked(data: u16) -> U14
Sourcepub fn try_from_slice(slice: &[u16]) -> Result<&[U14], Error>
pub fn try_from_slice(slice: &[u16]) -> Result<&[U14], Error>
Convert a slice of u16
into a slice of U14
. If any of the data is out of range, then an
error is returned.
Sourcepub fn data_to_slice(data: &[U14]) -> &[u16]
pub fn data_to_slice(data: &[U14]) -> &[u16]
Convert a slice of U14
into a slice u16
. Since U14
is a subset of u16
, this is a
simple cast.
Sourcepub unsafe fn from_slice_unchecked(slice: &[u16]) -> &[U14]
pub unsafe fn from_slice_unchecked(slice: &[u16]) -> &[U14]
Convert a slice of u16
to a slice of U14
without bounds checking.
§Safety
Behavior is undefined if any byte is > 16383.
Trait Implementations§
Source§impl Ord for U14
impl Ord for U14
Source§impl PartialOrd for U14
impl PartialOrd for U14
impl Copy for U14
impl Eq for U14
impl StructuralPartialEq for U14
Auto Trait Implementations§
impl Freeze for U14
impl RefUnwindSafe for U14
impl Send for U14
impl Sync for U14
impl Unpin for U14
impl UnwindSafe for U14
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