pub struct SafeArcDyn<T: ?Sized> { /* private fields */ }Expand description
A safe, cloneable, droppable reference to a dyn trait object loaded from a dynamic library. Uses Arc-like retain/release for memory safety.
Implementations§
Source§impl<T: ?Sized> SafeArcDyn<T>
impl<T: ?Sized> SafeArcDyn<T>
Sourcepub fn from_arc(value: Arc<T>) -> Self
pub fn from_arc(value: Arc<T>) -> Self
Create from an Arc<T>. The Arc’s reference count is managed
via the retain/release function pointers.
Sourcepub fn into_abi(self) -> AbiStableDynRef
pub fn into_abi(self) -> AbiStableDynRef
Get the ABI-stable representation (for exporting from a plugin).
Sourcepub unsafe fn from_abi(raw: AbiStableDynRef) -> Self
pub unsafe fn from_abi(raw: AbiStableDynRef) -> Self
Reconstruct from an ABI-stable representation (for loading in host).
§Safety
raw must have been created by SafeArcDyn::<T> or compatible code.
Trait Implementations§
Source§impl<T: ?Sized> Clone for SafeArcDyn<T>
impl<T: ?Sized> Clone for SafeArcDyn<T>
Source§impl<T: ?Sized> Drop for SafeArcDyn<T>
impl<T: ?Sized> Drop for SafeArcDyn<T>
impl<T: ?Sized + Send> Send for SafeArcDyn<T>
impl<T: ?Sized + Sync> Sync for SafeArcDyn<T>
Auto Trait Implementations§
impl<T> Freeze for SafeArcDyn<T>
impl<T> RefUnwindSafe for SafeArcDyn<T>
impl<T> Unpin for SafeArcDyn<T>
impl<T> UnsafeUnpin for SafeArcDyn<T>
impl<T> UnwindSafe for SafeArcDyn<T>
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