Enum Expression

Source
pub enum Expression {
Show 41 variants Bubble(Metadata, Box<Expression>, Box<Expression>), Atomic(Metadata, Atom), Abs(Metadata, Box<Expression>), Sum(Metadata, Vec<Expression>), Product(Metadata, Vec<Expression>), Min(Metadata, Vec<Expression>), Max(Metadata, Vec<Expression>), Not(Metadata, Box<Expression>), Or(Metadata, Vec<Expression>), And(Metadata, Vec<Expression>), Imply(Metadata, Box<Expression>, Box<Expression>), Eq(Metadata, Box<Expression>, Box<Expression>), Neq(Metadata, Box<Expression>, Box<Expression>), Geq(Metadata, Box<Expression>, Box<Expression>), Leq(Metadata, Box<Expression>, Box<Expression>), Gt(Metadata, Box<Expression>, Box<Expression>), Lt(Metadata, Box<Expression>, Box<Expression>), SafeDiv(Metadata, Box<Expression>, Box<Expression>), UnsafeDiv(Metadata, Box<Expression>, Box<Expression>), SafeMod(Metadata, Box<Expression>, Box<Expression>), UnsafeMod(Metadata, Box<Expression>, Box<Expression>), Neg(Metadata, Box<Expression>), UnsafePow(Metadata, Box<Expression>, Box<Expression>), SafePow(Metadata, Box<Expression>, Box<Expression>), AllDiff(Metadata, Vec<Expression>), Minus(Metadata, Box<Expression>, Box<Expression>), FlatAbsEq(Metadata, Atom, Atom), FlatSumGeq(Metadata, Vec<Atom>, Atom), FlatSumLeq(Metadata, Vec<Atom>, Atom), FlatIneq(Metadata, Atom, Atom, Literal), FlatWatchedLiteral(Metadata, Name, Literal), FlatWeightedSumLeq(Metadata, Vec<Literal>, Vec<Atom>, Atom), FlatWeightedSumGeq(Metadata, Vec<Literal>, Vec<Atom>, Atom), FlatMinusEq(Metadata, Atom, Atom), FlatProductEq(Metadata, Atom, Atom, Atom), MinionDivEqUndefZero(Metadata, Atom, Atom, Atom), MinionModuloEqUndefZero(Metadata, Atom, Atom, Atom), MinionPow(Metadata, Atom, Atom, Atom), MinionReify(Metadata, Box<Expression>, Atom), MinionReifyImply(Metadata, Box<Expression>, Atom), AuxDeclaration(Metadata, Name, Box<Expression>),
}
Expand description

Represents different types of expressions used to define rules and constraints in the model.

The Expression enum includes operations, constants, and variable references used to build rules and conditions for the model.

§Compatability

§Minion

§JsonInput

§SAT

Variants§

§

Bubble(Metadata, Box<Expression>, Box<Expression>)

An expression representing “A is valid as long as B is true” Turns into a conjunction when it reaches a boolean context

§

Atomic(Metadata, Atom)

§

Abs(Metadata, Box<Expression>)

|x| - absolute value of x Supported by: JsonInput.

§

Sum(Metadata, Vec<Expression>)

Supported by: JsonInput.

§

Product(Metadata, Vec<Expression>)

Supported by: JsonInput.

§

Min(Metadata, Vec<Expression>)

Supported by: JsonInput.

§

Max(Metadata, Vec<Expression>)

Supported by: JsonInput.

§

Not(Metadata, Box<Expression>)

Supported by: JsonInput, SAT.

§

Or(Metadata, Vec<Expression>)

Supported by: JsonInput, SAT.

§

And(Metadata, Vec<Expression>)

Supported by: JsonInput, SAT.

§

Imply(Metadata, Box<Expression>, Box<Expression>)

Ensures that a->b (material implication). Supported by: JsonInput.

§

Eq(Metadata, Box<Expression>, Box<Expression>)

Supported by: JsonInput.

§

Neq(Metadata, Box<Expression>, Box<Expression>)

Supported by: JsonInput.

§

Geq(Metadata, Box<Expression>, Box<Expression>)

Supported by: JsonInput.

§

Leq(Metadata, Box<Expression>, Box<Expression>)

Supported by: JsonInput.

§

Gt(Metadata, Box<Expression>, Box<Expression>)

Supported by: JsonInput.

§

Lt(Metadata, Box<Expression>, Box<Expression>)

Supported by: JsonInput.

§

SafeDiv(Metadata, Box<Expression>, Box<Expression>)

Division after preventing division by zero, usually with a bubble

§

UnsafeDiv(Metadata, Box<Expression>, Box<Expression>)

Division with a possibly undefined value (division by 0) Supported by: JsonInput.

§

SafeMod(Metadata, Box<Expression>, Box<Expression>)

Modulo after preventing mod 0, usually with a bubble

§

UnsafeMod(Metadata, Box<Expression>, Box<Expression>)

Modulo with a possibly undefined value (mod 0) Supported by: JsonInput.

§

Neg(Metadata, Box<Expression>)

Negation: -x Supported by: JsonInput.

§

UnsafePow(Metadata, Box<Expression>, Box<Expression>)

Unsafe powerx**y (possibly undefined)

Defined when (X!=0 \/ Y!=0) /\ Y>=0 Supported by: JsonInput.

§

SafePow(Metadata, Box<Expression>, Box<Expression>)

UnsafePow after preventing undefinedness

§

AllDiff(Metadata, Vec<Expression>)

Supported by: JsonInput.

§

Minus(Metadata, Box<Expression>, Box<Expression>)

Binary subtraction operator

This is a parser-level construct, and is immediately normalised to Sum([a,-b]). Supported by: JsonInput.

§

FlatAbsEq(Metadata, Atom, Atom)

Ensures that x=|y| i.e. x is the absolute value of y.

Low-level Minion constraint.

§See also

§

FlatSumGeq(Metadata, Vec<Atom>, Atom)

Ensures that sum(vec) >= x.

Low-level Minion constraint.

§See also

§

FlatSumLeq(Metadata, Vec<Atom>, Atom)

Ensures that sum(vec) <= x.

Low-level Minion constraint.

§See also

§

FlatIneq(Metadata, Atom, Atom, Literal)

ineq(x,y,k) ensures that x <= y + k.

Low-level Minion constraint.

§See also

§

FlatWatchedLiteral(Metadata, Name, Literal)

w-literal(x,k) ensures that x == k, where x is a variable and k a constant.

Low-level Minion constraint.

This is a low-level Minion constraint and you should probably use Eq instead. The main use of w-literal is to convert boolean variables to constraints so that they can be used inside watched-and and watched-or.

§See also

§

FlatWeightedSumLeq(Metadata, Vec<Literal>, Vec<Atom>, Atom)

weightedsumleq(cs,xs,total) ensures that cs.xs <= total, where cs.xs is the scalar dot product of cs and xs.

Low-level Minion constraint.

Represents a weighted sum of the form ax + by + cz + ...

§See also

§

FlatWeightedSumGeq(Metadata, Vec<Literal>, Vec<Atom>, Atom)

weightedsumgeq(cs,xs,total) ensures that cs.xs >= total, where cs.xs is the scalar dot product of cs and xs.

Low-level Minion constraint.

Represents a weighted sum of the form ax + by + cz + ...

§See also

§

FlatMinusEq(Metadata, Atom, Atom)

Ensures that x =-y, where x and y are atoms.

Low-level Minion constraint.

§See also

§

FlatProductEq(Metadata, Atom, Atom, Atom)

Ensures that x*y=z.

Low-level Minion constraint.

§See also

§

MinionDivEqUndefZero(Metadata, Atom, Atom, Atom)

Ensures that floor(x/y)=z. Always true when y=0.

Low-level Minion constraint.

§See also

§

MinionModuloEqUndefZero(Metadata, Atom, Atom, Atom)

Ensures that x%y=z. Always true when y=0.

Low-level Minion constraint.

§See also

§

MinionPow(Metadata, Atom, Atom, Atom)

Ensures that x**y = z.

Low-level Minion constraint.

This constraint is false when y<0 except for 1**y=1 and (-1)**y=z (where z is 1 if y is odd and z is -1 if y is even).

§See also

§

MinionReify(Metadata, Box<Expression>, Atom)

reify(constraint,r) ensures that r=1 iff constraint is satisfied, where r is a 0/1 variable.

Low-level Minion constraint.

§See also

§

MinionReifyImply(Metadata, Box<Expression>, Atom)

reifyimply(constraint,r) ensures that r->constraint, where r is a 0/1 variable. variable.

Low-level Minion constraint.

§See also

§

AuxDeclaration(Metadata, Name, Box<Expression>)

Declaration of an auxiliary variable.

As with Savile Row, we semantically distinguish this from Eq. Supported by: Minion.

Implementations§

Source§

impl Expression

Source

pub fn domain_of(&self, syms: &SymbolTable) -> Option<Domain>

Returns the possible values of the expression, recursing to leaf expressions

Source

pub fn get_meta(&self) -> Metadata

Source

pub fn set_meta(&self, meta: Metadata)

Source

pub fn is_safe(&self) -> bool

Checks whether this expression is safe.

An expression is unsafe if can be undefined, or if any of its children can be undefined.

Unsafe expressions are (typically) prefixed with Unsafe in our AST, and can be made safe through the use of bubble rules.

Source

pub fn return_type(&self) -> Option<ReturnType>

Source

pub fn is_clean(&self) -> bool

Source

pub fn set_clean(&mut self, bool_value: bool)

Source

pub fn is_associative_commutative_operator(&self) -> bool

True if the expression is an associative and commutative operator

Source

pub fn identical_atom_to(&self, other: &Expression) -> bool

True iff self and other are both atomic and identical.

This method is useful to cheaply check equivalence. Assuming CSE is enabled, any unifiable expressions will be rewritten to a common variable. This is much cheaper than checking the entire subtrees of self and other.

Trait Implementations§

Source§

impl Biplate<Atom> for Expression

Source§

fn biplate(&self) -> (Tree<Atom>, Box<dyn Fn(Tree<Atom>) -> Expression>)

Definition of a Biplate. Read more
§

fn with_children_bi(&self, children: VecDeque<To>) -> Self

Reconstructs the node with the given children. Read more
§

fn descend_bi(&self, op: Arc<dyn Fn(To) -> To>) -> Self

Biplate variant of [Uniplate::descend] Read more
§

fn universe_bi(&self) -> VecDeque<To>

Gets all children of a node, including itself and all children. Read more
§

fn children_bi(&self) -> VecDeque<To>

Returns the children of a type. If to == from then it returns the original element (in contrast to children). Read more
§

fn transform_bi(&self, op: Arc<dyn Fn(To) -> To>) -> Self

Applies the given function to all nodes bottom up. Read more
§

fn holes_bi(&self) -> impl Iterator<Item = (To, Arc<dyn Fn(To) -> Self>)>

Returns an iterator over all direct children of the input, paired with a function that “fills the hole” where the child was with a new value. Read more
§

fn contexts_bi(&self) -> impl Iterator<Item = (To, Arc<dyn Fn(To) -> Self>)>

Returns an iterator over the universe of the input, paired with a function that “fills the hole” where the child was with a new value. Read more
Source§

impl Biplate<Expression> for Atom

Source§

fn biplate(&self) -> (Tree<Expression>, Box<dyn Fn(Tree<Expression>) -> Atom>)

Definition of a Biplate. Read more
§

fn with_children_bi(&self, children: VecDeque<To>) -> Self

Reconstructs the node with the given children. Read more
§

fn descend_bi(&self, op: Arc<dyn Fn(To) -> To>) -> Self

Biplate variant of [Uniplate::descend] Read more
§

fn universe_bi(&self) -> VecDeque<To>

Gets all children of a node, including itself and all children. Read more
§

fn children_bi(&self) -> VecDeque<To>

Returns the children of a type. If to == from then it returns the original element (in contrast to children). Read more
§

fn transform_bi(&self, op: Arc<dyn Fn(To) -> To>) -> Self

Applies the given function to all nodes bottom up. Read more
§

fn holes_bi(&self) -> impl Iterator<Item = (To, Arc<dyn Fn(To) -> Self>)>

Returns an iterator over all direct children of the input, paired with a function that “fills the hole” where the child was with a new value. Read more
§

fn contexts_bi(&self) -> impl Iterator<Item = (To, Arc<dyn Fn(To) -> Self>)>

Returns an iterator over the universe of the input, paired with a function that “fills the hole” where the child was with a new value. Read more
Source§

impl Biplate<Expression> for Expression

Source§

fn biplate( &self, ) -> (Tree<Expression>, Box<dyn Fn(Tree<Expression>) -> Expression>)

Definition of a Biplate. Read more
§

fn with_children_bi(&self, children: VecDeque<To>) -> Self

Reconstructs the node with the given children. Read more
§

fn descend_bi(&self, op: Arc<dyn Fn(To) -> To>) -> Self

Biplate variant of [Uniplate::descend] Read more
§

fn universe_bi(&self) -> VecDeque<To>

Gets all children of a node, including itself and all children. Read more
§

fn children_bi(&self) -> VecDeque<To>

Returns the children of a type. If to == from then it returns the original element (in contrast to children). Read more
§

fn transform_bi(&self, op: Arc<dyn Fn(To) -> To>) -> Self

Applies the given function to all nodes bottom up. Read more
§

fn holes_bi(&self) -> impl Iterator<Item = (To, Arc<dyn Fn(To) -> Self>)>

Returns an iterator over all direct children of the input, paired with a function that “fills the hole” where the child was with a new value. Read more
§

fn contexts_bi(&self) -> impl Iterator<Item = (To, Arc<dyn Fn(To) -> Self>)>

Returns an iterator over the universe of the input, paired with a function that “fills the hole” where the child was with a new value. Read more
Source§

impl Biplate<Literal> for Expression

Source§

fn biplate(&self) -> (Tree<Literal>, Box<dyn Fn(Tree<Literal>) -> Expression>)

Definition of a Biplate. Read more
§

fn with_children_bi(&self, children: VecDeque<To>) -> Self

Reconstructs the node with the given children. Read more
§

fn descend_bi(&self, op: Arc<dyn Fn(To) -> To>) -> Self

Biplate variant of [Uniplate::descend] Read more
§

fn universe_bi(&self) -> VecDeque<To>

Gets all children of a node, including itself and all children. Read more
§

fn children_bi(&self) -> VecDeque<To>

Returns the children of a type. If to == from then it returns the original element (in contrast to children). Read more
§

fn transform_bi(&self, op: Arc<dyn Fn(To) -> To>) -> Self

Applies the given function to all nodes bottom up. Read more
§

fn holes_bi(&self) -> impl Iterator<Item = (To, Arc<dyn Fn(To) -> Self>)>

Returns an iterator over all direct children of the input, paired with a function that “fills the hole” where the child was with a new value. Read more
§

fn contexts_bi(&self) -> impl Iterator<Item = (To, Arc<dyn Fn(To) -> Self>)>

Returns an iterator over the universe of the input, paired with a function that “fills the hole” where the child was with a new value. Read more
Source§

impl Biplate<Metadata> for Expression

Source§

fn biplate(&self) -> (Tree<Metadata>, Box<dyn Fn(Tree<Metadata>) -> Expression>)

Definition of a Biplate. Read more
§

fn with_children_bi(&self, children: VecDeque<To>) -> Self

Reconstructs the node with the given children. Read more
§

fn descend_bi(&self, op: Arc<dyn Fn(To) -> To>) -> Self

Biplate variant of [Uniplate::descend] Read more
§

fn universe_bi(&self) -> VecDeque<To>

Gets all children of a node, including itself and all children. Read more
§

fn children_bi(&self) -> VecDeque<To>

Returns the children of a type. If to == from then it returns the original element (in contrast to children). Read more
§

fn transform_bi(&self, op: Arc<dyn Fn(To) -> To>) -> Self

Applies the given function to all nodes bottom up. Read more
§

fn holes_bi(&self) -> impl Iterator<Item = (To, Arc<dyn Fn(To) -> Self>)>

Returns an iterator over all direct children of the input, paired with a function that “fills the hole” where the child was with a new value. Read more
§

fn contexts_bi(&self) -> impl Iterator<Item = (To, Arc<dyn Fn(To) -> Self>)>

Returns an iterator over the universe of the input, paired with a function that “fills the hole” where the child was with a new value. Read more
Source§

impl Biplate<Name> for Expression

Source§

fn biplate(&self) -> (Tree<Name>, Box<dyn Fn(Tree<Name>) -> Expression>)

Definition of a Biplate. Read more
§

fn with_children_bi(&self, children: VecDeque<To>) -> Self

Reconstructs the node with the given children. Read more
§

fn descend_bi(&self, op: Arc<dyn Fn(To) -> To>) -> Self

Biplate variant of [Uniplate::descend] Read more
§

fn universe_bi(&self) -> VecDeque<To>

Gets all children of a node, including itself and all children. Read more
§

fn children_bi(&self) -> VecDeque<To>

Returns the children of a type. If to == from then it returns the original element (in contrast to children). Read more
§

fn transform_bi(&self, op: Arc<dyn Fn(To) -> To>) -> Self

Applies the given function to all nodes bottom up. Read more
§

fn holes_bi(&self) -> impl Iterator<Item = (To, Arc<dyn Fn(To) -> Self>)>

Returns an iterator over all direct children of the input, paired with a function that “fills the hole” where the child was with a new value. Read more
§

fn contexts_bi(&self) -> impl Iterator<Item = (To, Arc<dyn Fn(To) -> Self>)>

Returns an iterator over the universe of the input, paired with a function that “fills the hole” where the child was with a new value. Read more
Source§

impl Biplate<Vec<Expression>> for Expression

Source§

fn biplate( &self, ) -> (Tree<Vec<Expression>>, Box<dyn Fn(Tree<Vec<Expression>>) -> Expression>)

Definition of a Biplate. Read more
§

fn with_children_bi(&self, children: VecDeque<To>) -> Self

Reconstructs the node with the given children. Read more
§

fn descend_bi(&self, op: Arc<dyn Fn(To) -> To>) -> Self

Biplate variant of [Uniplate::descend] Read more
§

fn universe_bi(&self) -> VecDeque<To>

Gets all children of a node, including itself and all children. Read more
§

fn children_bi(&self) -> VecDeque<To>

Returns the children of a type. If to == from then it returns the original element (in contrast to children). Read more
§

fn transform_bi(&self, op: Arc<dyn Fn(To) -> To>) -> Self

Applies the given function to all nodes bottom up. Read more
§

fn holes_bi(&self) -> impl Iterator<Item = (To, Arc<dyn Fn(To) -> Self>)>

Returns an iterator over all direct children of the input, paired with a function that “fills the hole” where the child was with a new value. Read more
§

fn contexts_bi(&self) -> impl Iterator<Item = (To, Arc<dyn Fn(To) -> Self>)>

Returns an iterator over the universe of the input, paired with a function that “fills the hole” where the child was with a new value. Read more
Source§

impl Clone for Expression

Source§

fn clone(&self) -> Expression

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Expression

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for Expression

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Display for Expression

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl From<Atom> for Expression

Source§

fn from(value: Atom) -> Self

Converts to this type from the input type.
Source§

impl From<bool> for Expression

Source§

fn from(b: bool) -> Self

Converts to this type from the input type.
Source§

impl From<i32> for Expression

Source§

fn from(i: i32) -> Self

Converts to this type from the input type.
Source§

impl PartialEq for Expression

Source§

fn eq(&self, other: &Expression) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Serialize for Expression

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl<'a> TryFrom<&'a Expression> for &'a Atom

Source§

type Error = &'static str

The type returned in the event of a conversion error.
Source§

fn try_from(value: &'a Expression) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<Expression> for Atom

Source§

type Error = &'static str

The type returned in the event of a conversion error.
Source§

fn try_from(value: Expression) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl Uniplate for Expression

Source§

fn uniplate( &self, ) -> (Tree<Expression>, Box<dyn Fn(Tree<Expression>) -> Expression>)

Definition of a Uniplate. Read more
§

fn descend(&self, op: Arc<dyn Fn(Self) -> Self>) -> Self

Applies a function to all direct children of this Read more
§

fn universe(&self) -> VecDeque<Self>

Gets all children of a node, including itself and all children. Read more
§

fn children(&self) -> VecDeque<Self>

Gets the direct children (maximal substructures) of a node.
§

fn with_children(&self, children: VecDeque<Self>) -> Self

Reconstructs the node with the given children. Read more
§

fn transform(&self, f: Arc<dyn Fn(Self) -> Self>) -> Self

Applies the given function to all nodes bottom up.
§

fn rewrite(&self, f: Arc<dyn Fn(Self) -> Option<Self>>) -> Self

Rewrites by applying a rule everywhere it can.
§

fn cata<T>(&self, op: Arc<dyn Fn(Self, VecDeque<T>) -> T>) -> T

Performs a fold-like computation on each value. Read more
§

fn holes(&self) -> impl Iterator<Item = (Self, Arc<dyn Fn(Self) -> Self>)>

Returns an iterator over all direct children of the input, paired with a function that “fills the hole” where the child was with a new value.
§

fn contexts(&self) -> impl Iterator<Item = (Self, Arc<dyn Fn(Self) -> Self>)>

Returns an iterator over the universe of the input, paired with a function that “fills the hole” where the child was with a new value. Read more
Source§

impl Eq for Expression

Source§

impl StructuralPartialEq for Expression

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dst: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
Source§

impl<T> DynClone for T
where T: Clone,

Source§

fn __clone_box(&self, _: Private) -> *mut ()

§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
Source§

impl<T> Serialize for T
where T: Serialize + ?Sized,

Source§

fn erased_serialize(&self, serializer: &mut dyn Serializer) -> Result<(), Error>

Source§

fn do_erased_serialize( &self, serializer: &mut dyn Serializer, ) -> Result<(), ErrorImpl>

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,