Struct oc_wasm_safe::component::LastException
source · [−]pub struct LastException<'invoker>(_);Expand description
An object that is able to retrieve detailed method call error information.
Certain errors, when returned from a method call (and only from a method call!), are
accompanied by additional detailed error information which is only available until the next
method call. A value of this type uses the 'invoker lifetime parameter to prevent additional
method calls from being made until the caller has finished examining the detailed error
information.
Implementations
sourceimpl<'invoker> LastException<'invoker>
impl<'invoker> LastException<'invoker>
sourcepub fn message_length(&self) -> usize
pub fn message_length(&self) -> usize
Returns the length of the human-readable message for the error.
Panics
This function panics if the underlying syscall fails, because the only reasons it could fail should be impossible due to the type system.
sourcepub fn message<'buf>(&self, buffer: &'buf mut [u8]) -> Result<&'buf str>
pub fn message<'buf>(&self, buffer: &'buf mut [u8]) -> Result<&'buf str>
Returns the human-readable message for the error.
The message is written into buffer, and a string slice over the written text is returned.
Errors
BufferTooShortis returned ifbufferis not long enough to hold the error message.
Panics
This function panics if the underlying syscall fails for any reason other than
BufferTooShort, because the only other reasons it could fail
should be impossible due to the type system.
sourcepub fn is_type(&self, class: &str) -> bool
pub fn is_type(&self, class: &str) -> bool
Checks whether the Java exception underlying the error is of a certain type.
The class parameter must be the fully qualified name of a Java class (e.g.
java.io.IOException). This function returns true if the exception that caused the error
is class or a subclass thereof, or false if not.
Panics
This function panics if the underlying syscall fails, because the only reasons it could fail should be impossible due to the type system.
Trait Implementations
sourceimpl<'invoker> Clone for LastException<'invoker>
impl<'invoker> Clone for LastException<'invoker>
sourcefn clone(&self) -> LastException<'invoker>
fn clone(&self) -> LastException<'invoker>
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source. Read more
sourceimpl<'invoker> Debug for LastException<'invoker>
impl<'invoker> Debug for LastException<'invoker>
sourceimpl<'invoker> Hash for LastException<'invoker>
impl<'invoker> Hash for LastException<'invoker>
sourceimpl<'invoker> PartialEq<LastException<'invoker>> for LastException<'invoker>
impl<'invoker> PartialEq<LastException<'invoker>> for LastException<'invoker>
sourcefn eq(&self, other: &LastException<'invoker>) -> bool
fn eq(&self, other: &LastException<'invoker>) -> bool
This method tests for self and other values to be equal, and is used
by ==. Read more
sourcefn ne(&self, other: &LastException<'invoker>) -> bool
fn ne(&self, other: &LastException<'invoker>) -> bool
This method tests for !=.
impl<'invoker> Copy for LastException<'invoker>
impl<'invoker> Eq for LastException<'invoker>
impl<'invoker> StructuralEq for LastException<'invoker>
impl<'invoker> StructuralPartialEq for LastException<'invoker>
Auto Trait Implementations
impl<'invoker> RefUnwindSafe for LastException<'invoker>
impl<'invoker> Send for LastException<'invoker>
impl<'invoker> Sync for LastException<'invoker>
impl<'invoker> Unpin for LastException<'invoker>
impl<'invoker> !UnwindSafe for LastException<'invoker>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into)Uses borrowed data to replace owned data, usually by cloning. Read more