pub struct TryCatchResult<'a: 'b, 'b, T> { /* private fields */ }
Expand description
Implementations§
Source§impl<'a: 'b, 'b, T> TryCatchResult<'a, 'b, T>
impl<'a: 'b, 'b, T> TryCatchResult<'a, 'b, T>
Sourcepub fn catch(
self,
class: impl Desc<'a, JClass<'a>>,
block: impl FnOnce(JThrowable<'a>) -> Result<T, Error>,
) -> Self
pub fn catch( self, class: impl Desc<'a, JClass<'a>>, block: impl FnOnce(JThrowable<'a>) -> Result<T, Error>, ) -> Self
Attempt to catch an exception thrown by try_block
. If the thrown
exception matches the given class, the block is executed. If no
exception was thrown by try_block
, or if the exception does not
match the given class, the block is not executed.
§Arguments
class
- Exception class to match.block
- Block of JNI code to run.
Auto Trait Implementations§
impl<'a, 'b, T> Freeze for TryCatchResult<'a, 'b, T>where
T: Freeze,
impl<'a, 'b, T> RefUnwindSafe for TryCatchResult<'a, 'b, T>where
T: RefUnwindSafe,
impl<'a, 'b, T> !Send for TryCatchResult<'a, 'b, T>
impl<'a, 'b, T> !Sync for TryCatchResult<'a, 'b, T>
impl<'a, 'b, T> Unpin for TryCatchResult<'a, 'b, T>where
T: Unpin,
impl<'a, 'b, T> UnwindSafe for TryCatchResult<'a, 'b, T>where
T: UnwindSafe,
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