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,
impl<CD> Deref for ComponentDefinitionAccess<CD>where
CD: ComponentDefinition + 'static,
Source§impl<CD> DerefMut for ComponentDefinitionAccess<CD>where
CD: ComponentDefinition + 'static,
impl<CD> DerefMut for ComponentDefinitionAccess<CD>where
CD: ComponentDefinition + 'static,
impl<CD> Send for ComponentDefinitionAccess<CD>where
CD: ComponentDefinition + 'static,
Auto Trait Implementations§
impl<CD> Freeze for ComponentDefinitionAccess<CD>
impl<CD> RefUnwindSafe for ComponentDefinitionAccess<CD>where
CD: RefUnwindSafe,
impl<CD> !Sync for ComponentDefinitionAccess<CD>
impl<CD> Unpin for ComponentDefinitionAccess<CD>
impl<CD> UnsafeUnpin for ComponentDefinitionAccess<CD>
impl<CD> UnwindSafe for ComponentDefinitionAccess<CD>where
CD: RefUnwindSafe,
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
Source§impl<T, A> DynAccess<T> for A
impl<T, A> DynAccess<T> for A
Source§fn load(&self) -> DynGuard<T>
fn load(&self) -> DynGuard<T>
Access::load.