pub struct Factor {
pub slot: FactorSlot,
pub domain: FactorDomain,
}Expand description
A factor resolved against a model’s parameters and a spec’s actions, with every level checked.
Fields§
§slot: FactorSlotPart of a config the factor writes.
domain: FactorDomainValues the factor takes.
Implementations§
Source§impl Factor
impl Factor
Sourcepub fn levels(&self) -> Option<&[FactorLevel]>
pub fn levels(&self) -> Option<&[FactorLevel]>
Returns the listed levels, or None for a factor that takes a whole range.
Sourcepub fn apply(&self, level: &FactorLevel, config: &mut Config)
pub fn apply(&self, level: &FactorLevel, config: &mut Config)
Writes level into config.
§Panics
Panics when the kind of level does not match the slot, or the slot is past the end of config.
Trait Implementations§
impl StructuralPartialEq for Factor
Auto Trait Implementations§
impl Freeze for Factor
impl RefUnwindSafe for Factor
impl Send for Factor
impl Sync for Factor
impl Unpin for Factor
impl UnsafeUnpin for Factor
impl UnwindSafe for Factor
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