pub struct LastException<'invoker>(/* private fields */);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§
Source§impl<'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§
Source§impl<'invoker> Clone for LastException<'invoker>
impl<'invoker> Clone for LastException<'invoker>
Source§fn clone(&self) -> LastException<'invoker>
fn clone(&self) -> LastException<'invoker>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more