pub struct FixedWeight<Sc> { /* private fields */ }Expand description
Public wrapper for fixed score weights that are not one of the built-in score types.
Trait Implementations§
Source§impl<Sc: Clone> Clone for FixedWeight<Sc>
impl<Sc: Clone> Clone for FixedWeight<Sc>
Source§impl<'a, A, B, Sc: Score + Copy> ConstraintWeight<(&'a A, &'a B), Sc> for FixedWeight<Sc>
impl<'a, A, B, Sc: Score + Copy> ConstraintWeight<(&'a A, &'a B), Sc> for FixedWeight<Sc>
Source§fn score(&self, _args: (&'a A, &'a B)) -> Sc
fn score(&self, _args: (&'a A, &'a B)) -> Sc
The score one match with rows
args contributes, before the
constraint’s penalty or reward sign is applied.Source§fn is_hard(&self) -> bool
fn is_hard(&self) -> bool
Whether the constraint this weight scores is hard. Built-in fixed
scores are hard when their first (hard) level is non-zero; closures
are soft unless wrapped in
HardWeight.Source§impl<'a, A, B, C, Sc: Score + Copy> ConstraintWeight<(&'a A, &'a B, &'a C), Sc> for FixedWeight<Sc>
impl<'a, A, B, C, Sc: Score + Copy> ConstraintWeight<(&'a A, &'a B, &'a C), Sc> for FixedWeight<Sc>
Source§fn score(&self, _args: (&'a A, &'a B, &'a C)) -> Sc
fn score(&self, _args: (&'a A, &'a B, &'a C)) -> Sc
The score one match with rows
args contributes, before the
constraint’s penalty or reward sign is applied.Source§fn is_hard(&self) -> bool
fn is_hard(&self) -> bool
Whether the constraint this weight scores is hard. Built-in fixed
scores are hard when their first (hard) level is non-zero; closures
are soft unless wrapped in
HardWeight.Source§impl<'a, A, B, C, D, Sc: Score + Copy> ConstraintWeight<(&'a A, &'a B, &'a C, &'a D), Sc> for FixedWeight<Sc>
impl<'a, A, B, C, D, Sc: Score + Copy> ConstraintWeight<(&'a A, &'a B, &'a C, &'a D), Sc> for FixedWeight<Sc>
Source§fn score(&self, _args: (&'a A, &'a B, &'a C, &'a D)) -> Sc
fn score(&self, _args: (&'a A, &'a B, &'a C, &'a D)) -> Sc
The score one match with rows
args contributes, before the
constraint’s penalty or reward sign is applied.Source§fn is_hard(&self) -> bool
fn is_hard(&self) -> bool
Whether the constraint this weight scores is hard. Built-in fixed
scores are hard when their first (hard) level is non-zero; closures
are soft unless wrapped in
HardWeight.Source§impl<'a, A, B, C, D, E, Sc: Score + Copy> ConstraintWeight<(&'a A, &'a B, &'a C, &'a D, &'a E), Sc> for FixedWeight<Sc>
impl<'a, A, B, C, D, E, Sc: Score + Copy> ConstraintWeight<(&'a A, &'a B, &'a C, &'a D, &'a E), Sc> for FixedWeight<Sc>
Source§fn score(&self, _args: (&'a A, &'a B, &'a C, &'a D, &'a E)) -> Sc
fn score(&self, _args: (&'a A, &'a B, &'a C, &'a D, &'a E)) -> Sc
The score one match with rows
args contributes, before the
constraint’s penalty or reward sign is applied.Source§fn is_hard(&self) -> bool
fn is_hard(&self) -> bool
Whether the constraint this weight scores is hard. Built-in fixed
scores are hard when their first (hard) level is non-zero; closures
are soft unless wrapped in
HardWeight.Source§impl<'a, A, Sc: Score + Copy> ConstraintWeight<(&'a A,), Sc> for FixedWeight<Sc>
impl<'a, A, Sc: Score + Copy> ConstraintWeight<(&'a A,), Sc> for FixedWeight<Sc>
Source§fn score(&self, _args: (&'a A,)) -> Sc
fn score(&self, _args: (&'a A,)) -> Sc
The score one match with rows
args contributes, before the
constraint’s penalty or reward sign is applied.Source§fn is_hard(&self) -> bool
fn is_hard(&self) -> bool
Whether the constraint this weight scores is hard. Built-in fixed
scores are hard when their first (hard) level is non-zero; closures
are soft unless wrapped in
HardWeight.impl<Sc: Copy> Copy for FixedWeight<Sc>
Source§impl<Sc: Debug> Debug for FixedWeight<Sc>
impl<Sc: Debug> Debug for FixedWeight<Sc>
impl<Sc: Eq> Eq for FixedWeight<Sc>
Source§impl<Sc: PartialEq> PartialEq for FixedWeight<Sc>
impl<Sc: PartialEq> PartialEq for FixedWeight<Sc>
impl<Sc: PartialEq> StructuralPartialEq for FixedWeight<Sc>
Auto Trait Implementations§
impl<Sc> Forget for FixedWeight<Sc>
impl<Sc> Freeze for FixedWeight<Sc>where
Sc: Freeze,
impl<Sc> RefUnwindSafe for FixedWeight<Sc>where
Sc: RefUnwindSafe,
impl<Sc> Send for FixedWeight<Sc>where
Sc: Send,
impl<Sc> Sync for FixedWeight<Sc>where
Sc: Sync,
impl<Sc> Unpin for FixedWeight<Sc>where
Sc: Unpin,
impl<Sc> UnsafeUnpin for FixedWeight<Sc>where
Sc: UnsafeUnpin,
impl<Sc> UnwindSafe for FixedWeight<Sc>where
Sc: UnwindSafe,
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