[][src]Struct kompact::component::ComponentDefinitionAccess

pub struct ComponentDefinitionAccess<CD> where
    CD: ComponentDefinition + 'static, 
{ /* fields omitted */ }

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

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

type Target = CD

The resulting type after dereferencing.

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

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

Auto Trait Implementations

impl<CD> RefUnwindSafe for ComponentDefinitionAccess<CD> where
    CD: RefUnwindSafe

impl<CD> !Sync for ComponentDefinitionAccess<CD>

impl<CD> Unpin for ComponentDefinitionAccess<CD>

impl<CD> UnwindSafe for ComponentDefinitionAccess<CD> where
    CD: RefUnwindSafe

Blanket Implementations

impl<T, A, P> Access<T> for P where
    A: Access<T>,
    P: Deref<Target = A>, 
[src]

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

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

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T, A> DynAccess<T> for A where
    A: Access<T>,
    <A as Access<T>>::Guard: 'static, 
[src]

impl<T> Erased for T[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

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