pub struct JsError { /* private fields */ }Implementations§
Source§impl JsError
impl JsError
pub fn new(js: JsValue) -> Self
pub fn from_displayable<E: Display>(err: E) -> Self
pub fn new_from_str(message: impl AsRef<str>) -> Self
pub fn with_prefix(self, prefix: impl AsRef<str>) -> Self
pub fn with_data(self, data: JsValue) -> Self
pub fn with_serializable_data(self, data: impl Serialize) -> Self
pub fn message(&self) -> &str
pub fn log(&self)
Trait Implementations§
Source§impl Error for JsError
impl Error for JsError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
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
fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()
Source§impl From<Error> for JsError
impl From<Error> for JsError
Source§fn from(err: SerdeError) -> Self
fn from(err: SerdeError) -> Self
Converts to this type from the input type.
Source§impl From<ParseError> for JsError
impl From<ParseError> for JsError
Source§fn from(err: ParseError) -> Self
fn from(err: ParseError) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for JsError
impl RefUnwindSafe for JsError
impl !Send for JsError
impl !Sync for JsError
impl Unpin for JsError
impl UnwindSafe for JsError
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 moreSource§impl<T> SerializableKey for T
impl<T> SerializableKey for T
Source§impl<T> StorageAccess<T> for T
impl<T> StorageAccess<T> for T
Source§fn as_borrowed(&self) -> &T
fn as_borrowed(&self) -> &T
Borrows the value.
Source§fn into_taken(self) -> T
fn into_taken(self) -> T
Takes the value.