#[non_exhaustive]pub enum TabError {
Show 14 variants
Parse {
errors: Vec<ParseError>,
},
InputTooManyLines {
max: u32,
},
NumFretsTooHigh {
num_frets: u8,
max: u8,
},
CapoTooHigh {
capo: u8,
max: u8,
},
CapoExceedsFrets {
capo: u8,
num_frets: u8,
},
StringNumberOutOfRange {
value: u8,
max: u8,
},
OpenPitchOutOfRange {
string: u8,
semitones: i16,
},
FretRangeExceedsPitchRange {
open_pitch: String,
playable_frets: u8,
},
UnplayablePitches {
pitches: Vec<UnplayablePitch>,
},
NoArrangementsFound,
NumArrangementsOutOfRange {
value: u8,
max: u8,
},
TuningNameUnknown {
value: String,
},
IndexOutOfBounds {
index: usize,
len: usize,
},
RenderWidthTooSmall {
width: u16,
min: u16,
},
}Expand description
Top-level error variant for the WASM boundary.
Additional variants may be added in a non-breaking release; the #[non_exhaustive]
attribute requires external matches to include a wildcard arm. JS consumers should keep a
default arm in any switch (err.kind).
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Parse
Fields
errors: Vec<ParseError>InputTooManyLines
The input has more lines than the pathfinding graph can index. max is the inclusive
line limit (u16::MAX). Distinct from TabError::Parse because no single line is at
fault, so there is no ParseError line or text to report.
NumFretsTooHigh
CapoTooHigh
CapoExceedsFrets
StringNumberOutOfRange
OpenPitchOutOfRange
semitones is i16 (not u8) to mirror the offset arithmetic in crate::pitch::Pitch::plus_offset
and to leave room for negative tuning offsets without a future breaking change. The
2.x emit site populates 0..=Guitar::MAX_CAPO only.
FretRangeExceedsPitchRange
UnplayablePitches
Fields
pitches: Vec<UnplayablePitch>NoArrangementsFound
NumArrangementsOutOfRange
TuningNameUnknown
IndexOutOfBounds
RenderWidthTooSmall
The requested render width is below the minimum needed to lay out one beat at the
given padding. ArrangementSet::render rejects widths below min_render_width(padding).
Trait Implementations§
impl Eq for TabError
Source§impl Error for TabError
impl Error for TabError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()
Source§impl IntoWasmAbi for TabError
impl IntoWasmAbi for TabError
Source§impl OptionIntoWasmAbi for TabError
impl OptionIntoWasmAbi for TabError
impl StructuralPartialEq for TabError
Source§impl Tsify for TabError
impl Tsify for TabError
const DECL: &'static str = "/**\n * Top-level error variant for the WASM boundary.\n *\n * Additional variants may be added in a non-breaking release; the `#[non_exhaustive]`\n * attribute requires external matches to include a wildcard arm. JS consumers should keep a\n * `default` arm in any `switch (err.kind)`.\n */\nexport type TabError = { kind: \"parse\"; errors: ParseError[] } | { kind: \"inputTooManyLines\"; max: number } | { kind: \"numFretsTooHigh\"; numFrets: number; max: number } | { kind: \"capoTooHigh\"; capo: number; max: number } | { kind: \"capoExceedsFrets\"; capo: number; numFrets: number } | { kind: \"stringNumberOutOfRange\"; value: number; max: number } | { kind: \"openPitchOutOfRange\"; string: number; semitones: number } | { kind: \"fretRangeExceedsPitchRange\"; openPitch: string; playableFrets: number } | { kind: \"unplayablePitches\"; pitches: UnplayablePitch[] } | { kind: \"noArrangementsFound\" } | { kind: \"numArrangementsOutOfRange\"; value: number; max: number } | { kind: \"tuningNameUnknown\"; value: string } | { kind: \"indexOutOfBounds\"; index: number; len: number } | { kind: \"renderWidthTooSmall\"; width: number; min: number };"
const SERIALIZATION_CONFIG: SerializationConfig
type JsType = JsType
fn into_js(&self) -> Result<Self::JsType, Error>where
Self: Serialize,
Source§impl VectorIntoWasmAbi for TabError
impl VectorIntoWasmAbi for TabError
type Abi = <JsType as VectorIntoWasmAbi>::Abi
fn vector_into_abi(vector: Box<[Self]>) -> Self::Abi
Auto Trait Implementations§
impl Freeze for TabError
impl RefUnwindSafe for TabError
impl Send for TabError
impl Sync for TabError
impl Unpin for TabError
impl UnsafeUnpin for TabError
impl UnwindSafe for TabError
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
Source§impl<S, T> CastApprox<T> for Swhere
T: ConvApprox<S>,
impl<S, T> CastApprox<T> for Swhere
T: ConvApprox<S>,
Source§fn try_cast_approx(self) -> Result<T, Error>
fn try_cast_approx(self) -> Result<T, Error>
Source§fn cast_approx(self) -> T
fn cast_approx(self) -> T
Source§impl<S, T> CastFloat<T> for Swhere
T: ConvFloat<S>,
impl<S, T> CastFloat<T> for Swhere
T: ConvFloat<S>,
Source§fn cast_trunc(self) -> T
fn cast_trunc(self) -> T
Source§fn cast_nearest(self) -> T
fn cast_nearest(self) -> T
Source§fn cast_floor(self) -> T
fn cast_floor(self) -> T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.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>
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>
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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> ReturnWasmAbi for Twhere
T: IntoWasmAbi,
impl<T> ReturnWasmAbi for Twhere
T: IntoWasmAbi,
Source§type Abi = <T as IntoWasmAbi>::Abi
type Abi = <T as IntoWasmAbi>::Abi
IntoWasmAbi::AbiSource§fn return_abi(self) -> <T as ReturnWasmAbi>::Abi
fn return_abi(self) -> <T as ReturnWasmAbi>::Abi
IntoWasmAbi::into_abi, except that it may throw and never
return in the case of Err.