Skip to main content

ComponentDefinitionAccess

Struct ComponentDefinitionAccess 

Source
pub struct ComponentDefinitionAccess<CD>
where CD: ComponentDefinition + 'static,
{ /* private fields */ }
Expand description

Gives access to the component definition within a future/async function

This is only guaranteed to be correct when accessed as part of the future’s poll function.

In particular, under no circumstances should you ever send this anywhere else (e.g. on a channel, or as part of spawned off closure). The only reason this is marked as Send is so the futures it produces can be sent with their parent component.

This also means you may not hold references to fields within the component across await points. You must either drop them manually before calling await, or simply use a sub-scope and let them go out of scope first. It is then safe to reacquire them following the await.

If the future is not being used as a blocking variant, no assumptions about the state of the component should be made after the await point and everthing previously established must be re-verified on the new references if it could at all have changed between two poll invocations.

Trait Implementations§

Source§

impl<CD> Deref for ComponentDefinitionAccess<CD>
where CD: ComponentDefinition + 'static,

Source§

type Target = CD

The resulting type after dereferencing.
Source§

fn deref(&self) -> &<ComponentDefinitionAccess<CD> as Deref>::Target

Dereferences the value.
Source§

impl<CD> DerefMut for ComponentDefinitionAccess<CD>
where CD: ComponentDefinition + 'static,

Source§

fn deref_mut(&mut self) -> &mut <ComponentDefinitionAccess<CD> as Deref>::Target

Mutably dereferences the value.
Source§

impl<CD> Send for ComponentDefinitionAccess<CD>
where CD: ComponentDefinition + 'static,

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T, A, P> Access<T> for P
where A: Access<T> + ?Sized, P: Deref<Target = A>,

Source§

type Guard = <A as Access<T>>::Guard

A guard object containing the value and keeping it alive. Read more
Source§

fn load(&self) -> <P as Access<T>>::Guard

The loading method. Read more
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, A> DynAccess<T> for A
where A: Access<T>, <A as Access<T>>::Guard: 'static,

Source§

fn load(&self) -> DynGuard<T>

The equivalent of Access::load.
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> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<P, T> Receiver for P
where P: Deref<Target = T> + ?Sized, T: ?Sized,

Source§

type Target = T

🔬This is a nightly-only experimental API. (arbitrary_self_types)
The target type on which the method may be called.
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.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> Erased for T

Source§

impl<T> Formattable for T
where T: Deref, <T as Deref>::Target: Formattable,