pub struct PluginCustomDataRef { /* private fields */ }Expand description
Borrowed view of a plug-in custom-data value during on_data dispatch.
The value stays owned by the host-side wrapper. Plug-in code can inspect the type name and downcast to a concrete custom-data type that was declared in the same cdylib manifest.
Implementations§
Source§impl PluginCustomDataRef
impl PluginCustomDataRef
Sourcepub unsafe fn from_raw_parts(
type_name: BorrowedStr<'static>,
vtable: *const CustomDataVTable,
handle: *const CustomDataHandle,
) -> Self
pub unsafe fn from_raw_parts( type_name: BorrowedStr<'static>, vtable: *const CustomDataVTable, handle: *const CustomDataHandle, ) -> Self
Constructs a borrowed custom-data reference from raw boundary parts.
§Safety
handle must be null or point at a live value allocated by vtable,
and type_name must name the same concrete custom-data type for the
duration of the call.
Sourcepub fn downcast_ref<T>(&self) -> Option<&T>
pub fn downcast_ref<T>(&self) -> Option<&T>
Returns the value as T when it was allocated by T’s vtable.
Trait Implementations§
Source§impl Clone for PluginCustomDataRef
impl Clone for PluginCustomDataRef
Source§fn clone(&self) -> PluginCustomDataRef
fn clone(&self) -> PluginCustomDataRef
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for PluginCustomDataRef
Auto Trait Implementations§
impl !Send for PluginCustomDataRef
impl !Sync for PluginCustomDataRef
impl Freeze for PluginCustomDataRef
impl RefUnwindSafe for PluginCustomDataRef
impl Unpin for PluginCustomDataRef
impl UnsafeUnpin for PluginCustomDataRef
impl UnwindSafe for PluginCustomDataRef
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