Struct wmidi::U7[][src]

pub struct U7(_);

A data byte that holds 7 bits of information.

Implementations

impl U7[src]

pub const MIN: U7[src]

The minimum value for a u7 data byte.

pub const MAX: U7[src]

The maximum value for a u7 data byte.

pub unsafe fn from_unchecked(data: u8) -> U7[src]

Convert a u8 into a U7 without bounds checking.

Safety

Behavior is undefined if data > 127.

pub fn try_from_bytes(bytes: &[u8]) -> Result<&[U7], Error>[src]

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

pub fn data_to_bytes(data: &[U7]) -> &[u8][src]

Convert a slice of U7 into a slice u8. Since U7 is a subset of u8, this is a simple cast.

pub unsafe fn from_bytes_unchecked(bytes: &[u8]) -> &[U7][src]

Convert a slice of u8 to a slice of U7 without bounds checking.

Safety

Behavior is undefined if any byte is > 127.

Trait Implementations

impl Clone for U7[src]

impl Copy for U7[src]

impl Debug for U7[src]

impl Default for U7[src]

impl Eq for U7[src]

impl From<ControlFunction> for U7[src]

impl From<U7> for ControlFunction[src]

impl From<U7> for Note[src]

impl Hash for U7[src]

impl Ord for U7[src]

impl PartialEq<U7> for U7[src]

impl PartialOrd<U7> for U7[src]

impl StructuralEq for U7[src]

impl StructuralPartialEq for U7[src]

impl TryFrom<u8> for U7[src]

type Error = Error

The type returned in the event of a conversion error.

Auto Trait Implementations

impl RefUnwindSafe for U7[src]

impl Send for U7[src]

impl Sync for U7[src]

impl Unpin for U7[src]

impl UnwindSafe for U7[src]

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.