pub struct HardWeight<W> { /* private fields */ }Expand description
Public wrapper that marks a fixed or dynamic weight as hard metadata.
Trait Implementations§
Source§impl<W: Clone> Clone for HardWeight<W>
impl<W: Clone> Clone for HardWeight<W>
Source§impl<'a, A, B, W, Sc> ConstraintWeight<(&'a A, &'a B), Sc> for HardWeight<W>
impl<'a, A, B, W, Sc> ConstraintWeight<(&'a A, &'a B), Sc> for HardWeight<W>
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, W, Sc> ConstraintWeight<(&'a A, &'a B, &'a C), Sc> for HardWeight<W>
impl<'a, A, B, C, W, Sc> ConstraintWeight<(&'a A, &'a B, &'a C), Sc> for HardWeight<W>
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, W, Sc> ConstraintWeight<(&'a A, &'a B, &'a C, &'a D), Sc> for HardWeight<W>
impl<'a, A, B, C, D, W, Sc> ConstraintWeight<(&'a A, &'a B, &'a C, &'a D), Sc> for HardWeight<W>
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, W, Sc> ConstraintWeight<(&'a A, &'a B, &'a C, &'a D, &'a E), Sc> for HardWeight<W>
impl<'a, A, B, C, D, E, W, Sc> ConstraintWeight<(&'a A, &'a B, &'a C, &'a D, &'a E), Sc> for HardWeight<W>
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, W, Sc> ConstraintWeight<(&'a A,), Sc> for HardWeight<W>
impl<'a, A, W, Sc> ConstraintWeight<(&'a A,), Sc> for HardWeight<W>
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<W: Copy> Copy for HardWeight<W>
Source§impl<W: Debug> Debug for HardWeight<W>
impl<W: Debug> Debug for HardWeight<W>
impl<W: Eq> Eq for HardWeight<W>
Source§impl<W: PartialEq> PartialEq for HardWeight<W>
impl<W: PartialEq> PartialEq for HardWeight<W>
impl<W: PartialEq> StructuralPartialEq for HardWeight<W>
Auto Trait Implementations§
impl<W> Forget for HardWeight<W>
impl<W> Freeze for HardWeight<W>where
W: Freeze,
impl<W> RefUnwindSafe for HardWeight<W>where
W: RefUnwindSafe,
impl<W> Send for HardWeight<W>where
W: Send,
impl<W> Sync for HardWeight<W>where
W: Sync,
impl<W> Unpin for HardWeight<W>where
W: Unpin,
impl<W> UnsafeUnpin for HardWeight<W>where
W: UnsafeUnpin,
impl<W> UnwindSafe for HardWeight<W>where
W: 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