#[repr(C, u8)]pub enum PluginResult<T> {
Ok(T),
Err(PluginError),
}Expand description
A Result-shaped union for boundary calls.
#[repr(C, u8)] so the discriminant is a single byte at offset zero,
independent of payload alignment.
Variants§
Ok(T)
Err(PluginError)
Implementations§
Source§impl<T> PluginResult<T>
impl<T> PluginResult<T>
Sourcepub fn into_result(self) -> Result<T, PluginError>
pub fn into_result(self) -> Result<T, PluginError>
Converts to a core::result::Result, dropping the discriminant.
Sourcepub fn from_result(r: Result<T, PluginError>) -> Self
pub fn from_result(r: Result<T, PluginError>) -> Self
Wraps a Result produced inside Rust into a boundary result.
Auto Trait Implementations§
impl<T> !Sync for PluginResult<T>
impl<T> Freeze for PluginResult<T>where
T: Freeze,
impl<T> RefUnwindSafe for PluginResult<T>where
T: RefUnwindSafe,
impl<T> Send for PluginResult<T>where
T: Send,
impl<T> Unpin for PluginResult<T>where
T: Unpin,
impl<T> UnsafeUnpin for PluginResult<T>where
T: UnsafeUnpin,
impl<T> UnwindSafe for PluginResult<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