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§
source§impl Ord for Text
impl Ord for Text
source§impl PartialOrd for Text
impl PartialOrd for Text
impl Eq 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 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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)