lumina_node_wasm::error

Struct Error

source
pub struct Error(/* private fields */);
Expand description

An error that can cross the WASM ABI border.

Implementations§

source§

impl Error

source

pub fn new(msg: &str) -> Error

Create a new Error with the specified message.

source

pub fn from_js_value<T>(value: T) -> Error
where T: Into<JsValue>,

Create a new Error from JsValue without losing any information.

source

pub fn from_display<T>(value: T) -> Error
where T: Display,

Create a new Error from any type that implements Display.

This can be used on types that implement std::error::Error but some information is lost.

source

pub fn context<C>(self, context: C) -> Error
where C: Display,

Add more context to the Error.

Trait Implementations§

source§

impl Debug for Error

source§

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

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

impl<'de> Deserialize<'de> for Error

source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
source§

impl Display for Error

source§

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

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

impl From<Error> for Error

source§

fn from(value: Error) -> Error

Converts to this type from the input type.
source§

impl From<Error> for Error

source§

fn from(value: Error) -> Error

Converts to this type from the input type.
source§

impl From<Error> for Error

source§

fn from(value: Error) -> Error

Converts to this type from the input type.
source§

impl From<Error> for Error

source§

fn from(value: Error) -> Error

Converts to this type from the input type.
source§

impl From<Error> for JsValue

source§

fn from(error: Error) -> JsValue

Converts to this type from the input type.
source§

impl From<JsError> for Error

source§

fn from(value: JsError) -> Error

Converts to this type from the input type.
source§

impl From<JsValue> for Error

source§

fn from(value: JsValue) -> Error

Converts to this type from the input type.
source§

impl From<NodeError> for Error

source§

fn from(value: NodeError) -> Error

Converts to this type from the input type.
source§

impl From<ParseError> for Error

source§

fn from(value: ParseError) -> Error

Converts to this type from the input type.
source§

impl From<StoreError> for Error

source§

fn from(value: StoreError) -> Error

Converts to this type from the input type.
source§

impl IntoWasmAbi for Error

source§

type Abi = <JsValue 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 Serialize for Error

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 WasmDescribe for Error

Auto Trait Implementations§

§

impl Freeze for Error

§

impl RefUnwindSafe for Error

§

impl !Send for Error

§

impl !Sync for Error

§

impl Unpin for Error

§

impl UnwindSafe for Error

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<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> 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> Same for T

source§

type Output = T

Should always be Self
source§

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

source§

default 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<V, T> VZip<V> for T
where V: MultiLane<T>,

source§

fn vzip(self) -> V

source§

impl<T> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

impl<S> CondSend for S

source§

impl<S> CondSync for S

source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,