Struct wmidi::U7 [−][src]
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]
pub const fn from_u8_lossy(data: u8) -> U7
[src]
Create a U7
from a u8
. Only the 7 least significant bits of note
are kept.
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]
fn from(control_function: ControlFunction) -> U7
[src]
impl From<U7> for ControlFunction
[src]
fn from(data: U7) -> ControlFunction
[src]
impl From<U7> for Note
[src]
impl Hash for U7
[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 Ord for U7
[src]
fn cmp(&self, other: &U7) -> Ordering
[src]
#[must_use]pub fn max(self, other: Self) -> Self
1.21.0[src]
#[must_use]pub fn min(self, other: Self) -> Self
1.21.0[src]
#[must_use]pub fn clamp(self, min: Self, max: Self) -> Self
1.50.0[src]
impl PartialEq<U7> for U7
[src]
impl PartialOrd<U7> for U7
[src]
fn partial_cmp(&self, other: &U7) -> Option<Ordering>
[src]
#[must_use]pub fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
impl StructuralEq for U7
[src]
impl StructuralPartialEq for U7
[src]
impl TryFrom<u8> for U7
[src]
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]
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> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
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>,