pub struct ModelPrecisionRegistry { /* private fields */ }Expand description
Registry mapping model identifiers to precision targets and active profiles.
Implementations§
Source§impl ModelPrecisionRegistry
impl ModelPrecisionRegistry
Sourcepub fn register(&mut self, target: ModelPrecisionTarget)
pub fn register(&mut self, target: ModelPrecisionTarget)
Register a model precision target.
Sourcepub fn get(&self, model_id: &str) -> Option<&ModelPrecisionTarget>
pub fn get(&self, model_id: &str) -> Option<&ModelPrecisionTarget>
Retrieve a model precision target by ID.
Sourcepub fn get_mut(&mut self, model_id: &str) -> Option<&mut ModelPrecisionTarget>
pub fn get_mut(&mut self, model_id: &str) -> Option<&mut ModelPrecisionTarget>
Retrieve a mutable reference to a model precision target by ID.
Sourcepub fn set_active_profile(
&mut self,
model_id: &str,
profile_id: impl Into<String>,
) -> Result<(), &'static str>
pub fn set_active_profile( &mut self, model_id: &str, profile_id: impl Into<String>, ) -> Result<(), &'static str>
Associate an active conditioning profile with a model.
Sourcepub fn clear_active_profile(
&mut self,
model_id: &str,
) -> Result<(), &'static str>
pub fn clear_active_profile( &mut self, model_id: &str, ) -> Result<(), &'static str>
Clear any active conditioning profile and contract from a model target.
Sourcepub fn bind_active_contract(
&mut self,
model_id: &str,
contract: ModelPrecisionContract,
) -> Result<(), &'static str>
pub fn bind_active_contract( &mut self, model_id: &str, contract: ModelPrecisionContract, ) -> Result<(), &'static str>
Bind a contract to a target whose profile pointer has already been set. A later profile change clears this binding, preventing a stale contract from being applied to a new profile version.
Sourcepub fn resolve_active_contract(
&self,
model_id: &str,
conditioning: &ConditioningRegistry,
) -> Option<&ModelPrecisionContract>
pub fn resolve_active_contract( &self, model_id: &str, conditioning: &ConditioningRegistry, ) -> Option<&ModelPrecisionContract>
Resolve an eligible contract only when the active model mapping and conditioning lifecycle record agree exactly on profile ID, version, and specification identity.
Sourcepub fn iter(&self) -> impl Iterator<Item = &ModelPrecisionTarget>
pub fn iter(&self) -> impl Iterator<Item = &ModelPrecisionTarget>
Returns an iterator over all mapped model targets.
Trait Implementations§
Source§impl Debug for ModelPrecisionRegistry
impl Debug for ModelPrecisionRegistry
Auto Trait Implementations§
impl Freeze for ModelPrecisionRegistry
impl RefUnwindSafe for ModelPrecisionRegistry
impl Send for ModelPrecisionRegistry
impl Sync for ModelPrecisionRegistry
impl Unpin for ModelPrecisionRegistry
impl UnsafeUnpin for ModelPrecisionRegistry
impl UnwindSafe for ModelPrecisionRegistry
Blanket Implementations§
§impl<S, A> Aggregate<Result<S, Error>> for Awhere
A: Aggregate<S>,
impl<S, A> Aggregate<Result<S, Error>> for Awhere
A: Aggregate<S>,
Aggregate shares in an MPC protocol.
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
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§impl<T> NoneValue for Twhere
T: Default,
impl<T> NoneValue for Twhere
T: Default,
type NoneType = T
§fn null_value() -> T
fn null_value() -> T
The none-equivalent value.