pub struct AssemblyCtx<'x, S>where
S: ReactorInitializer,{ /* 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>where
S: ReactorInitializer,
impl<'x, S> AssemblyCtx<'x, S>where
S: ReactorInitializer,
Sourcepub fn assemble(
self,
build_reactor_tree: impl FnOnce(Self) -> AssemblyResult<AssemblyIntermediate<'x, S>>,
) -> AssemblyResult<FinishedReactor<'x, S>>
pub fn assemble( self, build_reactor_tree: impl FnOnce(Self) -> AssemblyResult<AssemblyIntermediate<'x, S>>, ) -> AssemblyResult<FinishedReactor<'x, S>>
top level function
Sourcepub 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>>
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.
Sourcepub fn with_child<Sub: ReactorInitializer + 'static, F>(
self,
inst_name: &'static str,
args: Sub::Params,
action: F,
) -> AssemblyResult<AssemblyIntermediate<'x, S>>
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.
Sourcepub 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,
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> 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
Mutably borrows from an owned value. Read more