pub struct CompositeExternalProvider { /* private fields */ }Expand description
An ExternalConditionProvider that delegates to multiple providers in order.
For each evaluate() call, providers are consulted in sequence. The first
provider that returns a non-Unknown result wins.
If all providers return Unknown (or there are no providers), Unknown is
returned.
This is useful for layering: e.g., a caller-supplied map on top of a system-default provider.
Implementations§
Source§impl CompositeExternalProvider
impl CompositeExternalProvider
Sourcepub fn new(providers: Vec<Box<dyn ExternalConditionProvider>>) -> Self
pub fn new(providers: Vec<Box<dyn ExternalConditionProvider>>) -> Self
Creates a new CompositeExternalProvider from the given provider list.
Providers are consulted in the order they appear in the vector.
Sourcepub fn with_defaults(
sector: Option<Sector>,
roles: Option<(Vec<MarketRole>, Vec<MarketRole>)>,
code_list_json: Option<&str>,
) -> Self
pub fn with_defaults( sector: Option<Sector>, roles: Option<(Vec<MarketRole>, Vec<MarketRole>)>, code_list_json: Option<&str>, ) -> Self
Build a composite provider with the standard static providers.
sector: If Some, adds aSectorProviderroles: If Some((sender_roles, recipient_roles)), adds aMarketRoleProvidercode_list_json: If Some, adds aCodeListProviderloaded from JSONkonfigurationen_json: If Some((json, product_code)), adds aKonfigurationenProvider
Sourcepub fn builder() -> CompositeProviderBuilder
pub fn builder() -> CompositeProviderBuilder
Start building a composite provider with fine-grained control.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for CompositeExternalProvider
impl !RefUnwindSafe for CompositeExternalProvider
impl Send for CompositeExternalProvider
impl Sync for CompositeExternalProvider
impl Unpin for CompositeExternalProvider
impl UnsafeUnpin for CompositeExternalProvider
impl !UnwindSafe for CompositeExternalProvider
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