pub struct SupplyManager { /* private fields */ }Expand description
Manager that holds and provides supplies.
The SupplyManager is the central registry for all supplies used by the solver.
It creates supplies on-demand when first requested and caches them for reuse.
§Thread Safety
The manager uses Arc for shared ownership, allowing supplies to be accessed
from multiple threads during parallel solving.
Implementations§
Source§impl SupplyManager
impl SupplyManager
Sourcepub fn demand<D: SupplyDemand>(&mut self, demand: &D) -> Arc<D::Output>
pub fn demand<D: SupplyDemand>(&mut self, demand: &D) -> Arc<D::Output>
Gets or creates a supply for the given demand.
If the supply already exists, returns a clone of the Arc.
Otherwise, creates a new supply using the demand’s create_supply method.
Sourcepub fn register<S: Supply>(&mut self, key: DemandKey, supply: Arc<S>)
pub fn register<S: Supply>(&mut self, key: DemandKey, supply: Arc<S>)
Registers a pre-created supply.
This is useful when supplies are created externally and need to be registered with the manager.
Trait Implementations§
Source§impl Debug for SupplyManager
impl Debug for SupplyManager
Source§impl Default for SupplyManager
impl Default for SupplyManager
Source§fn default() -> SupplyManager
fn default() -> SupplyManager
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for SupplyManager
impl !RefUnwindSafe for SupplyManager
impl Send for SupplyManager
impl Sync for SupplyManager
impl Unpin for SupplyManager
impl !UnwindSafe for SupplyManager
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