#[non_exhaustive]pub struct PlacedError {
pub error: Error,
pub position: Position,
}Expand description
An error that is no format’s own, and where in its document a reader met it.
use music21::error::{Error, Position};
let error = music21::tinynotation::from_tiny_notation("4/4 c4 e99999999999999999999");
let error = error.unwrap_err();
assert!(error.to_string().starts_with("Duration error: Cannot parse token"));
assert!(matches!(error.unplaced(), Error::Duration(_)));
assert_eq!(error.position(), Some(&Position::line(1).with_column(8)));Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.error: ErrorWhat went wrong.
position: PositionWhere.
Trait Implementations§
Source§impl Clone for PlacedError
impl Clone for PlacedError
Source§impl Debug for PlacedError
impl Debug for PlacedError
Source§impl Display for PlacedError
impl Display for PlacedError
impl Eq for PlacedError
Source§impl PartialEq for PlacedError
impl PartialEq for PlacedError
impl StructuralPartialEq for PlacedError
Auto Trait Implementations§
impl Forget for PlacedError
impl Freeze for PlacedError
impl RefUnwindSafe for PlacedError
impl Send for PlacedError
impl Sync for PlacedError
impl Unpin for PlacedError
impl UnsafeUnpin for PlacedError
impl UnwindSafe for PlacedError
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§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more