Struct wmidi::U14[][src]

pub struct U14(_);

A combination of 2 data bytes that holds 14 bits of information.

Implementations

impl U14[src]

pub const MIN: U14[src]

The minimum value for a u14 data byte.

pub const MAX: U14[src]

The maximum value for a u7 data byte.

pub unsafe fn from_unchecked(data: u16) -> U14[src]

Convert a u8 into a U7 without bounds checking.

Safety

Behavior is undefined if data is > 16383.

pub fn try_from_slice(slice: &[u16]) -> Result<&[U14], Error>[src]

Convert a slice of u16 into a slice of U14. If any of the data is out of range, then an error is returned.

pub fn data_to_slice(data: &[U14]) -> &[u16][src]

Convert a slice of U14 into a slice u16. Since U14 is a subset of u16, this is a simple cast.

pub unsafe fn from_slice_unchecked(slice: &[u16]) -> &[U14][src]

Convert a slice of u16 to a slice of U14 without bounds checking.

Safety

Behavior is undefined if any byte is > 16383.

Trait Implementations

impl Clone for U14[src]

impl Copy for U14[src]

impl Debug for U14[src]

impl Default for U14[src]

impl Eq for U14[src]

impl Hash for U14[src]

impl Ord for U14[src]

impl PartialEq<U14> for U14[src]

impl PartialOrd<U14> for U14[src]

impl StructuralEq for U14[src]

impl StructuralPartialEq for U14[src]

impl TryFrom<u16> for U14[src]

type Error = Error

The type returned in the event of a conversion error.

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.