Enum rquickjs_core::Error[][src]

pub enum Error {
    Allocation,
    InvalidString(NulError),
    Utf8(Utf8Error),
    Io(IoError),
    Exception {
        message: StdString,
        file: StdString,
        line: i32,
        stack: StdString,
    },
    FromJs {
        from: &'static str,
        to: &'static str,
        message: Option<StdString>,
    },
    IntoJs {
        from: &'static str,
        to: &'static str,
        message: Option<StdString>,
    },
    NumArgs {
        expected: Range<usize>,
        given: usize,
    },
    Resolving {
        base: StdString,
        name: StdString,
        message: Option<StdString>,
    },
    Loading {
        name: StdString,
        message: Option<StdString>,
    },
    Unknown,
}
Expand description

Error type of the library.

Variants

Allocation

Could not allocate memory This is generally only triggered when out of memory.

InvalidString(NulError)

Found a string with a internal null byte while converting to C string.

Tuple Fields of InvalidString

0: NulError
Utf8(Utf8Error)

String from rquickjs was not UTF-8

Tuple Fields of Utf8

0: Utf8Error

An io error

Tuple Fields of Io

0: IoError
Exception

An exception raised by quickjs itself.

Fields of Exception

message: StdStringfile: StdStringline: i32stack: StdString
FromJs

Error converting from javascript to a rust type.

Fields of FromJs

from: &'static strto: &'static strmessage: Option<StdString>
IntoJs

Error converting to javascript from a rust type.

Fields of IntoJs

from: &'static strto: &'static strmessage: Option<StdString>
NumArgs

Error matching of function arguments

Fields of NumArgs

expected: Range<usize>given: usize
Resolving
This is supported on crate feature loader only.

Error when resolving js module

Fields of Resolving

base: StdStringname: StdStringmessage: Option<StdString>
Loading
This is supported on crate feature loader only.

Error when loading js module

Fields of Loading

name: StdStringmessage: Option<StdString>
Unknown

An error from quickjs from which the specifics are unknown. Should eventually be removed as development progresses.

Implementations

This is supported on crate feature loader only.

Create resolving error

This is supported on crate feature loader only.

Create resolving error with message

This is supported on crate feature loader only.

Returns whether the error is a resolving error

This is supported on crate feature loader only.

Create loading error

This is supported on crate feature loader only.

Create loading error

This is supported on crate feature loader only.

Returns whether the error is a loading error

Returns whether the error is a quickjs generated exception.

Create from JS conversion error

Create from JS conversion error with message

Create into JS conversion error

Create into JS conversion error with message

Returns whether the error is a from JS conversion error

Returns whether the error is a from JS to JS type conversion error

Returns whether the error is an into JS conversion error

Create function args mismatch error

Return whether the error is an function args mismatch error

Trait Implementations

Formats the value using the given formatter. Read more

Formats the value using the given formatter. Read more

The lower-level source of this error, if any. Read more

🔬 This is a nightly-only experimental API. (backtrace)

Returns a stack backtrace, if available, of where this error occurred. Read more

👎 Deprecated since 1.42.0:

use the Display impl or to_string()

👎 Deprecated since 1.33.0:

replaced by Error::source, which can support downcasting

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

Converts the given value to a String. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.