pub struct SerialRealizerRegistry { /* private fields */ }Expand description
Id-addressed registry of serial realizers with stable sorted listing.
Implementations§
Source§impl SerialRealizerRegistry
impl SerialRealizerRegistry
Sourcepub fn new() -> SerialRealizerRegistry
pub fn new() -> SerialRealizerRegistry
Creates an empty registry.
Sourcepub fn register(
&mut self,
realizer: Arc<dyn SerialRealizer>,
) -> Result<(), RealizerId>
pub fn register( &mut self, realizer: Arc<dyn SerialRealizer>, ) -> Result<(), RealizerId>
Inserts one realizer, rejecting duplicate ids unless the caller uses replace.
Sourcepub fn replace(
&mut self,
realizer: Arc<dyn SerialRealizer>,
) -> Option<Arc<dyn SerialRealizer>>
pub fn replace( &mut self, realizer: Arc<dyn SerialRealizer>, ) -> Option<Arc<dyn SerialRealizer>>
Inserts one realizer and returns the replaced registration, if any.
Sourcepub fn get(&self, id: &RealizerId) -> Option<&Arc<dyn SerialRealizer>>
pub fn get(&self, id: &RealizerId) -> Option<&Arc<dyn SerialRealizer>>
Returns one registered realizer by id.
Sourcepub fn ids(&self) -> Vec<RealizerId>
pub fn ids(&self) -> Vec<RealizerId>
Returns all registered ids in stable sorted order.
Sourcepub fn realize(
&self,
id: &RealizerId,
plan: &SerialPlan,
context: &RealizationContext,
) -> Result<SerialRealization, StrictRealizationError>
pub fn realize( &self, id: &RealizerId, plan: &SerialPlan, context: &RealizationContext, ) -> Result<SerialRealization, StrictRealizationError>
Realizes one plan through the registered realizer named by id.
Sourcepub fn realize_named(
&self,
id: &str,
plan: &SerialPlan,
context: &RealizationContext,
) -> Result<SerialRealization, StrictRealizationError>
pub fn realize_named( &self, id: &str, plan: &SerialPlan, context: &RealizationContext, ) -> Result<SerialRealization, StrictRealizationError>
Realizes one plan through the registered realizer named by a stable string id.
Trait Implementations§
Source§impl Clone for SerialRealizerRegistry
impl Clone for SerialRealizerRegistry
Source§fn clone(&self) -> SerialRealizerRegistry
fn clone(&self) -> SerialRealizerRegistry
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Default for SerialRealizerRegistry
impl Default for SerialRealizerRegistry
Source§fn default() -> SerialRealizerRegistry
fn default() -> SerialRealizerRegistry
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl !RefUnwindSafe for SerialRealizerRegistry
impl !UnwindSafe for SerialRealizerRegistry
impl Freeze for SerialRealizerRegistry
impl Send for SerialRealizerRegistry
impl Sync for SerialRealizerRegistry
impl Unpin for SerialRealizerRegistry
impl UnsafeUnpin for SerialRealizerRegistry
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more