Skip to main content

TabError

Enum TabError 

Source
#[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
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

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.

Fields

§max: u32
§

NumFretsTooHigh

Fields

§num_frets: u8
§max: u8
§

CapoTooHigh

Fields

§capo: u8
§max: u8
§

CapoExceedsFrets

Fields

§capo: u8
§num_frets: u8
§

StringNumberOutOfRange

Fields

§value: u8
§max: u8
§

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.

Fields

§string: u8
§semitones: i16
§

FretRangeExceedsPitchRange

Fields

§open_pitch: String
§playable_frets: u8
§

UnplayablePitches

Fields

§

NoArrangementsFound

§

NumArrangementsOutOfRange

Fields

§value: u8
§max: u8
§

TuningNameUnknown

Fields

§value: String
§

IndexOutOfBounds

Fields

§index: usize
§len: usize
§

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).

Fields

§width: u16
§min: u16

Trait Implementations§

Source§

impl Clone for TabError

Source§

fn clone(&self) -> TabError

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for TabError

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Display for TabError

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Eq for TabError

Source§

impl Error for TabError

1.30.0 · Source§

fn source(&self) -> Option<&(dyn Error + 'static)>

Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§

fn description(&self) -> &str

👎Deprecated since 1.42.0:

use the Display impl or to_string()

1.0.0 · Source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0:

replaced by Error::source, which can support downcasting

Source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type-based access to context intended for error reports. Read more
Source§

impl From<TabError> for JsValue

Source§

fn from(value: TabError) -> Self

Converts to this type from the input type.
Source§

impl IntoWasmAbi for TabError

Source§

type Abi = <JsType as IntoWasmAbi>::Abi

The Wasm ABI type that this converts into when crossing the ABI boundary.
Source§

fn into_abi(self) -> Self::Abi

Convert self into Self::Abi so that it can be sent across the wasm ABI boundary.
Source§

impl OptionIntoWasmAbi for TabError

Source§

fn none() -> Self::Abi

Returns an ABI instance indicating “none”, which JS will interpret as the None branch of this option. Read more
Source§

impl PartialEq for TabError

Source§

fn eq(&self, other: &TabError) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Serialize for TabError

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for TabError

Source§

impl Tsify for TabError

Source§

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 };"

Source§

const SERIALIZATION_CONFIG: SerializationConfig

Source§

type JsType = JsType

Source§

fn into_js(&self) -> Result<Self::JsType, Error>
where Self: Serialize,

Source§

impl VectorIntoWasmAbi for TabError

Source§

type Abi = <JsType as VectorIntoWasmAbi>::Abi

Source§

fn vector_into_abi(vector: Box<[Self]>) -> Self::Abi

Source§

impl WasmDescribe for TabError

Source§

impl WasmDescribeVector for TabError

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<S, T> Cast<T> for S
where T: Conv<S>,

Source§

fn cast(self) -> T

Cast from Self to T Read more
Source§

fn try_cast(self) -> Result<T, Error>

Try converting from Self to T Read more
Source§

impl<S, T> CastApprox<T> for S
where T: ConvApprox<S>,

Source§

fn try_cast_approx(self) -> Result<T, Error>

Try approximate conversion from Self to T Read more
Source§

fn cast_approx(self) -> T

Cast approximately from Self to T Read more
Source§

impl<S, T> CastFloat<T> for S
where T: ConvFloat<S>,

Source§

fn cast_trunc(self) -> T

Cast to integer, truncating Read more
Source§

fn cast_nearest(self) -> T

Cast to the nearest integer Read more
Source§

fn cast_floor(self) -> T

Cast the floor to an integer Read more
Source§

fn cast_ceil(self) -> T

Cast the ceiling to an integer Read more
Source§

fn try_cast_trunc(self) -> Result<T, Error>

Try converting to integer with truncation Read more
Source§

fn try_cast_nearest(self) -> Result<T, Error>

Try converting to the nearest integer Read more
Source§

fn try_cast_floor(self) -> Result<T, Error>

Try converting the floor to an integer Read more
Source§

fn try_cast_ceil(self) -> Result<T, Error>

Try convert the ceiling to an integer Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> ReturnWasmAbi for T
where T: IntoWasmAbi,

Source§

type Abi = <T as IntoWasmAbi>::Abi

Same as IntoWasmAbi::Abi
Source§

fn return_abi(self) -> <T as ReturnWasmAbi>::Abi

Same as IntoWasmAbi::into_abi, except that it may throw and never return in the case of Err.
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<S, T> Upcast<T> for S
where T: UpcastFrom<S> + ?Sized, S: ?Sized,

Source§

fn upcast(&self) -> &T
where Self: ErasableGeneric, T: Sized + ErasableGeneric<Repr = Self::Repr>,

Perform a zero-cost type-safe upcast to a wider ref type within the Wasm bindgen generics type system. Read more
Source§

fn upcast_into(self) -> T
where Self: Sized + ErasableGeneric, T: Sized + ErasableGeneric<Repr = Self::Repr>,

Perform a zero-cost type-safe upcast to a wider type within the Wasm bindgen generics type system. Read more