Skip to main content

ComponentRegistrar

Struct ComponentRegistrar 

Source
pub struct ComponentRegistrar<'engine, 'a, S: EngineSpec> { /* private fields */ }
Expand description

Provides component context against which a step can be registered.

Implementations§

Source§

impl<'engine, 'a, S: EngineSpec> ComponentRegistrar<'engine, 'a, S>

Source

pub fn component(&self) -> &S::Component

Returns the component associated with this registrar.

Source

pub fn new_step<F, Fut, T>( &self, id: S::StepId, description: impl Into<Cow<'static, str>>, step_fn: F, ) -> NewStep<'engine, 'a, S, T>
where F: FnOnce(StepContext<S>) -> Fut + Send + 'a, Fut: Future<Output = Result<StepResult<T, S>, S::Error>> + Send + 'a, T: Send + 'a,

Adds a new step corresponding to the component associated with the registrar.

§Notes

The step will be considered to keep running until both the future completes and the StepContext is dropped. In normal use, both happen at the same time. However, it is technically possible to make the StepContext escape the future.

(Ideally, this would be prevented by making the function take a &mut StepContext, but there are limitations in stable Rust which make this impossible to achieve.)

Auto Trait Implementations§

§

impl<'engine, 'a, S> Freeze for ComponentRegistrar<'engine, 'a, S>
where <S as EngineSpec>::Component: Freeze,

§

impl<'engine, 'a, S> RefUnwindSafe for ComponentRegistrar<'engine, 'a, S>

§

impl<'engine, 'a, S> Send for ComponentRegistrar<'engine, 'a, S>

§

impl<'engine, 'a, S> Sync for ComponentRegistrar<'engine, 'a, S>

§

impl<'engine, 'a, S> Unpin for ComponentRegistrar<'engine, 'a, S>
where <S as EngineSpec>::Component: Unpin,

§

impl<'engine, 'a, S> UnsafeUnpin for ComponentRegistrar<'engine, 'a, S>

§

impl<'engine, 'a, S> UnwindSafe for ComponentRegistrar<'engine, 'a, S>

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.
Source§

impl<T> SendSyncUnwindSafe for T
where T: Send + Sync + UnwindSafe + ?Sized,