pub enum Text {
Utf8(String),
Other(Vec<u8>),
}Expand description
The MIDI spec does not state what encoding should be used for strings. Since Rust strings are
UTF-8 encoded, we try to parse text as a String and hope for the best. But if we get an error
then we store the original bytes to facilitate lossless parsing.
Variants§
Utf8(String)
A UTF-8 encoded string.
Other(Vec<u8>)
Some bytes that we don’t understand, probably a string in some non-UTF-8 encoding.
Implementations§
Trait Implementations§
impl Eq for Text
Source§impl Ord for Text
impl Ord for Text
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialOrd for Text
impl PartialOrd for Text
impl StructuralPartialEq for Text
Auto Trait Implementations§
impl Freeze for Text
impl RefUnwindSafe for Text
impl Send for Text
impl Sync for Text
impl Unpin for Text
impl UnsafeUnpin for Text
impl UnwindSafe for Text
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