pub struct FxRateGenerator { /* private fields */ }Expand description
Generates a complete set of FX rates for a simulation period.
Implementations§
Source§impl FxRateGenerator
impl FxRateGenerator
Sourcepub fn new(config: FxRateServiceConfig, rng: ChaCha8Rng) -> Self
pub fn new(config: FxRateServiceConfig, rng: ChaCha8Rng) -> Self
Creates a new FX rate generator.
Sourcepub fn with_seed(config: FxRateServiceConfig, seed: u64) -> Self
pub fn with_seed(config: FxRateServiceConfig, seed: u64) -> Self
Creates a new FX rate generator from a seed, constructing the RNG internally.
Sourcepub fn generate_all_rates(
&mut self,
start_date: NaiveDate,
end_date: NaiveDate,
) -> GeneratedFxRates
pub fn generate_all_rates( &mut self, start_date: NaiveDate, end_date: NaiveDate, ) -> GeneratedFxRates
Generates all rates (daily, closing, average) for a date range.
Sourcepub fn service(&self) -> &FxRateService
pub fn service(&self) -> &FxRateService
Gets a reference to the underlying service.
Sourcepub fn service_mut(&mut self) -> &mut FxRateService
pub fn service_mut(&mut self) -> &mut FxRateService
Gets a mutable reference to the underlying service.
Auto Trait Implementations§
impl Freeze for FxRateGenerator
impl RefUnwindSafe for FxRateGenerator
impl Send for FxRateGenerator
impl Sync for FxRateGenerator
impl Unpin for FxRateGenerator
impl UnsafeUnpin for FxRateGenerator
impl UnwindSafe for FxRateGenerator
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.