pub struct Affinity {
pub strength: Strength,
pub target: Target,
pub anti: bool,
}Expand description
A typed affinity constraint.
§Examples
use grafos_std::affinity::{Affinity, Strength, Target};
// Required: place on node 42.
let a = Affinity::new(Strength::Required, Target::node(42));
// Preferred anti-affinity: avoid rack 7.
let b = Affinity::anti(Strength::Preferred, Target::rack(7));
// Required trust domain.
let c = Affinity::new(Strength::Required, Target::trust_domain("secure-enclave"));Fields§
§strength: Strength§target: Target§anti: boolImplementations§
Trait Implementations§
impl Eq for Affinity
impl StructuralPartialEq for Affinity
Auto Trait Implementations§
impl Freeze for Affinity
impl RefUnwindSafe for Affinity
impl Send for Affinity
impl Sync for Affinity
impl Unpin for Affinity
impl UnwindSafe for Affinity
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