Struct bytes_cast::unaligned::U16Be [−][src]
Big-endian u16, without alignment requirement.
Implements the BytesCast trait to reinterpret &[u8] byte slices, and the From and Into traits to convert to and from u16.
Implementations
impl U16Be[src]
Converts to native-endian. Same as .into(), but .into() may need a type annotation.
Trait Implementations
impl BytesCast for U16Be[src]
fn from_bytes(bytes: &[u8]) -> Result<(&Self, &[u8]), FromBytesError> where
Self: Sized, [src]
Self: Sized,
fn slice_from_bytes(
bytes: &[u8],
slice_len: usize
) -> Result<(&[Self], &[u8]), FromBytesError> where
Self: Sized, [src]
bytes: &[u8],
slice_len: usize
) -> Result<(&[Self], &[u8]), FromBytesError> where
Self: Sized,
fn as_bytes(&self) -> &[u8][src]
impl Clone for U16Be[src]
fn clone(&self) -> U16Be[src]
pub fn clone_from(&mut self, source: &Self)1.0.0[src]
impl Copy for U16Be[src]
impl Debug for U16Be[src]
impl Eq for U16Be[src]
impl From<u16> for U16Be[src]
Converts from native-endian
impl Hash for U16Be[src]
fn hash<__H: Hasher>(&self, state: &mut __H)[src]
pub fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher, 1.3.0[src]
H: Hasher,
impl PartialEq<U16Be> for U16Be[src]
impl StructuralEq for U16Be[src]
impl StructuralPartialEq for U16Be[src]
Auto Trait Implementations
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized, [src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized, [src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T[src]
impl<T> From<T> for T[src]
impl<T, U> Into<U> for T where
U: From<T>, [src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>, [src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>, [src]
U: TryFrom<T>,