[−][src]Struct c_bridge::RustBox
An interface to work with FfiObjects
containing a boxed Rust object
Methods
impl RustBox
[src]
pub fn as_ref(&self) -> &(dyn Any + 'static)
[src]
The underlying element as reference
pub fn as_mut(&mut self) -> &mut (dyn Any + 'static)
[src]
The underlying element as mutable reference
pub fn move_into_box(self) -> Result<Box<dyn Any + 'static>, Self>
[src]
Moves the underlying memory from the payload out of the FfiObject
and creates a Box
from it
Note: this only works if the Rust object was created using from_object
(which should
almost always be the case)
Trait Implementations
impl From<RustBox> for FfiObject
[src]
impl<T: Any + 'static> From<Box<T>> for RustBox
[src]
fn from(boxed: Box<T>) -> Self
[src]
Creates a new Box
from object
and encapsulates it into a wrapped and owned FfiObject
impl TryFrom<FfiObject> for RustBox
[src]
Auto Trait Implementations
impl !Send for RustBox
impl Unpin for RustBox
impl !Sync for RustBox
impl RefUnwindSafe for RustBox
impl UnwindSafe for RustBox
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> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,