pub struct ContextRegistry { /* private fields */ }Expand description
The extension-side concrete representation of a Context.
This can be considered the actual context instance, while Context
serves as an abstract handle or outer wrapper around it.
This struct is only constructed via FlashRuntime::with_context_initializer.
Implementations§
Source§impl ContextRegistry
impl ContextRegistry
pub fn context_type(&self) -> Option<UCStr>
pub fn context_data(&self) -> Option<&dyn Any>
pub fn context_data_mut(&mut self) -> &mut Option<Box<dyn Any>>
Sourcepub unsafe fn extension_data(&self) -> Option<&dyn Any>
pub unsafe fn extension_data(&self) -> Option<&dyn Any>
Returns a reference to the extension data.
§Safety
This method assumes that ext_data was either constructed via
Data::into_raw or is a null pointer.
Violating these assumptions may lead to undefined behavior.
Sourcepub unsafe fn extension_data_mut(&mut self) -> Option<&mut dyn Any>
pub unsafe fn extension_data_mut(&mut self) -> Option<&mut dyn Any>
Returns a mutable reference to the extension data.
§Safety
This method assumes that ext_data was either constructed via
Data::into_raw or is a null pointer.
Violating these assumptions may lead to undefined behavior.
Trait Implementations§
Source§impl Data for ContextRegistry
impl Data for ContextRegistry
fn into_boxed(self) -> Box<dyn Any>
fn into_raw(self) -> NonNullFREData
fn from_boxed(boxed: Box<dyn Any>) -> Result<Self, Box<dyn Any>>
unsafe fn from_raw(raw: NonNullFREData) -> Self
unsafe fn ref_from<'a>(raw: NonNullFREData) -> Result<&'a Self, &'a dyn Any>
unsafe fn mut_from<'a>( raw: NonNullFREData, ) -> Result<&'a mut Self, &'a mut dyn Any>
Auto Trait Implementations§
impl Freeze for ContextRegistry
impl !RefUnwindSafe for ContextRegistry
impl !Send for ContextRegistry
impl !Sync for ContextRegistry
impl Unpin for ContextRegistry
impl UnsafeUnpin for ContextRegistry
impl !UnwindSafe for ContextRegistry
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