Struct AssemblyCtx

Source
pub struct AssemblyCtx<'x, S>{ /* private fields */ }
Expand description

Helper struct to assemble reactors during initialization. One assembly context is used per reactor, they can’t be shared.

Implementations§

Source§

impl<'x, S> AssemblyCtx<'x, S>

Source

pub fn assemble( self, build_reactor_tree: impl FnOnce(Self) -> AssemblyResult<AssemblyIntermediate<'x, S>>, ) -> AssemblyResult<FinishedReactor<'x, S>>

top level function

Source

pub fn assemble_self<const N: usize>( self, create_self: impl FnOnce(&mut ComponentCreator<'_, '_, S>, ReactorId) -> Result<S, AssemblyError>, num_non_synthetic_reactions: usize, reaction_names: [Option<&'static str>; N], declare_dependencies: impl FnOnce(&mut DependencyDeclarator<'_, '_, S>, &mut S, [GlobalReactionId; N]) -> AssemblyResult<()>, ) -> AssemblyResult<AssemblyIntermediate<'x, S>>

Innermost function.

Source

pub fn with_child<Sub: ReactorInitializer + 'static, F>( self, inst_name: &'static str, args: Sub::Params, action: F, ) -> AssemblyResult<AssemblyIntermediate<'x, S>>

Assembles a child reactor and makes it available in the scope of a function.

Source

pub fn with_child_bank<Sub, A, F>( self, inst_name: &'static str, bank_width: usize, arg_maker: A, action: F, ) -> AssemblyResult<AssemblyIntermediate<'x, S>>
where Sub: ReactorInitializer + 'static, F: FnOnce(Self, &mut Vec<Sub>) -> AssemblyResult<AssemblyIntermediate<'x, S>>, A: Fn(usize) -> Sub::Params,

Assembles a bank of children reactor and makes it available in the scope of a function.

Auto Trait Implementations§

§

impl<'x, S> Freeze for AssemblyCtx<'x, S>

§

impl<'x, S> !RefUnwindSafe for AssemblyCtx<'x, S>

§

impl<'x, S> !Send for AssemblyCtx<'x, S>

§

impl<'x, S> !Sync for AssemblyCtx<'x, S>

§

impl<'x, S> Unpin for AssemblyCtx<'x, S>
where S: Unpin,

§

impl<'x, S> !UnwindSafe for AssemblyCtx<'x, 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.