[−][src]Struct c_bridge::FfiResult
A FFI-compatible result type
Fields
dealloc: unsafe extern "C" fn(_: *mut Self)
The deallocator
into_ok: unsafe extern "C" fn(_: *mut Self) -> T
Consumes the object and returns the underlying result
into_err: unsafe extern "C" fn(_: *mut Self) -> E
Consumes the object and returns the underlying error
is_ok: unsafe extern "C" fn(_: *const Self) -> u8
Indicates if the result is ok (1
) or if it contains an error (0
)
object: *mut c_void
The underlying object (implementation dependent)
Methods
impl<T, E> FfiResult<T, E>
[src]
pub fn into_result(self) -> Result<T, E>
[src]
Converts self
into a Rust result
pub fn map<R>(self, f: impl FnOnce(T) -> R) -> Result<R, E>
[src]
Maps the Ok
-variant of the result
pub fn map_err<R>(self, f: impl FnOnce(E) -> R) -> Result<T, R>
[src]
Maps the Err
-variant of the result
Trait Implementations
impl<T, E> Drop for FfiResult<T, E>
[src]
impl<T, E> Into<Result<T, E>> for FfiResult<T, E>
[src]
impl<T, E> From<Result<T, E>> for FfiResult<T, E>
[src]
Auto Trait Implementations
impl<T, E> !Send for FfiResult<T, E>
impl<T, E> !Sync for FfiResult<T, E>
impl<T, E> Unpin for FfiResult<T, E>
impl<T, E> UnwindSafe for FfiResult<T, E>
impl<T, E> RefUnwindSafe for FfiResult<T, E>
Blanket Implementations
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From<T> for T
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,