pub struct StructLiteral { /* private fields */ }Expand description
A straightforward literal representation using a struct.
Stores the variable ID and polarity in separate fields.
Less memory-efficient than PackedLiteral if not optimised well by the compiler,
but very clear.
Trait Implementations§
Source§impl Clone for StructLiteral
impl Clone for StructLiteral
Source§fn clone(&self) -> StructLiteral
fn clone(&self) -> StructLiteral
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for StructLiteral
impl Debug for StructLiteral
Source§impl Default for StructLiteral
impl Default for StructLiteral
Source§fn default() -> StructLiteral
fn default() -> StructLiteral
Returns the “default value” for a type. Read more
Source§impl Hash for StructLiteral
impl Hash for StructLiteral
Source§impl Literal for StructLiteral
impl Literal for StructLiteral
Source§fn negated(self) -> Self
fn negated(self) -> Self
Returns the negated version of this literal.
If
self is x_i, returns !x_i.
If self is !x_i, returns x_i.Source§fn is_negated(self) -> bool
fn is_negated(self) -> bool
Checks if the literal is negated (i.e. has negative polarity).
This is equivalent to
!self.polarity().Source§fn is_positive(self) -> bool
fn is_positive(self) -> bool
Checks if the literal is positive (i.e. has positive polarity).
This is equivalent to
self.polarity().Source§fn to_i32(&self) -> i32
fn to_i32(&self) -> i32
Converts the literal to its
i32 (DIMACS-style) representation.
Positive literal x_v becomes v (as i32).
Negative literal !x_v becomes -v (as i32). Read moreSource§fn from_index(index: usize) -> Self
fn from_index(index: usize) -> Self
Source§impl Ord for StructLiteral
impl Ord for StructLiteral
Source§fn cmp(&self, other: &StructLiteral) -> Ordering
fn cmp(&self, other: &StructLiteral) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialEq for StructLiteral
impl PartialEq for StructLiteral
Source§impl PartialOrd for StructLiteral
impl PartialOrd for StructLiteral
impl Copy for StructLiteral
impl Eq for StructLiteral
impl StructuralPartialEq for StructLiteral
Auto Trait Implementations§
impl Freeze for StructLiteral
impl RefUnwindSafe for StructLiteral
impl Send for StructLiteral
impl Sync for StructLiteral
impl Unpin for StructLiteral
impl UnwindSafe for StructLiteral
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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