pub struct GenericEngine<A, R> { /* private fields */ }Expand description
Typed storage and observable plumbing shared by concrete engines.
Mirrors the C++ GenericEngine<ArgumentsType, ResultsType>: carries the
argument and result bundles and the engine’s observable, plus the observer
half (the C++ update() { notifyObservers(); }) as a forwarder to register
with the engine’s inputs via register_with.
A concrete engine embeds one, delegates its PricingEngine accessors to
it, and only implements calculate.
Implementations§
Source§impl<A: Arguments, R: Results> GenericEngine<A, R>
impl<A: Arguments, R: Results> GenericEngine<A, R>
Sourcepub fn new(arguments: A, results: R) -> Self
pub fn new(arguments: A, results: R) -> Self
Creates the engine base around its argument and result bundles.
Sourcepub fn arguments_mut(&mut self) -> &mut A
pub fn arguments_mut(&mut self) -> &mut A
Mutable access to the typed argument bundle.
Sourcepub fn results_mut(&mut self) -> &mut R
pub fn results_mut(&mut self) -> &mut R
Mutable access to the typed result bundle.
Sourcepub fn register_with(&self, source: &Observable) -> bool
pub fn register_with(&self, source: &Observable) -> bool
Registers the engine as an observer of source, so the source’s
notifications are forwarded to the engine’s own observers (the C++
registerWith on an engine input).
Trait Implementations§
Source§impl<A, R> AsObservable for GenericEngine<A, R>
impl<A, R> AsObservable for GenericEngine<A, R>
Source§fn observable(&self) -> &Observable
fn observable(&self) -> &Observable
Access to the embedded observable for registering observers.
Auto Trait Implementations§
impl<A, R> !RefUnwindSafe for GenericEngine<A, R>
impl<A, R> !Send for GenericEngine<A, R>
impl<A, R> !Sync for GenericEngine<A, R>
impl<A, R> !UnwindSafe for GenericEngine<A, R>
impl<A, R> Freeze for GenericEngine<A, R>
impl<A, R> Unpin for GenericEngine<A, R>
impl<A, R> UnsafeUnpin for GenericEngine<A, R>where
A: UnsafeUnpin,
R: UnsafeUnpin,
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