Skip to main content

ContextRegistry

Struct ContextRegistry 

Source
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

Source

pub fn context_type(&self) -> Option<UCStr>

Source

pub fn context_data(&self) -> Option<&dyn Any>

Source

pub fn context_data_mut(&mut self) -> &mut Option<Box<dyn Any>>

Source

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.

Source

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

Source§

fn into_boxed(self) -> Box<dyn Any>

Source§

fn into_raw(self) -> NonNullFREData

Source§

fn from_boxed(boxed: Box<dyn Any>) -> Result<Self, Box<dyn Any>>

Source§

unsafe fn from_raw(raw: NonNullFREData) -> Self

Source§

unsafe fn ref_from<'a>(raw: NonNullFREData) -> Result<&'a Self, &'a dyn Any>

Source§

unsafe fn mut_from<'a>( raw: NonNullFREData, ) -> Result<&'a mut Self, &'a mut dyn Any>

Source§

impl Debug for ContextRegistry

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.