pub enum AbstractLiteral<T>where
T: Uniplate + Biplate<AbstractLiteral<T>> + Biplate<T>,{
Set(Vec<T>),
Matrix(Vec<T>, Domain),
}
Variants§
Implementations§
Source§impl<T> AbstractLiteral<T>where
T: Uniplate + Biplate<AbstractLiteral<T>> + Biplate<T>,
impl<T> AbstractLiteral<T>where
T: Uniplate + Biplate<AbstractLiteral<T>> + Biplate<T>,
Sourcepub fn matrix_implied_indices(elems: Vec<T>) -> AbstractLiteral<T>
pub fn matrix_implied_indices(elems: Vec<T>) -> AbstractLiteral<T>
Creates a matrix with elements elems
, with domain int(1..)
.
This acts as a variable sized list.
Sourcepub fn unwrap_list(&self) -> Option<&Vec<T>>
pub fn unwrap_list(&self) -> Option<&Vec<T>>
If the AbstractLiteral is a list, returns its elements.
A list is any a matrix with the domain int(1..)
. This includes matrix literals without
any explicitly specified domain.
Trait Implementations§
Source§impl Biplate<AbstractLiteral<Expression>> for Expression
impl Biplate<AbstractLiteral<Expression>> for Expression
Source§fn biplate(
&self,
) -> (Tree<AbstractLiteral<Expression>>, Box<dyn Fn(Tree<AbstractLiteral<Expression>>) -> Expression>)
fn biplate( &self, ) -> (Tree<AbstractLiteral<Expression>>, Box<dyn Fn(Tree<AbstractLiteral<Expression>>) -> Expression>)
Definition of a Biplate. Read more
§fn with_children_bi(&self, children: VecDeque<To>) -> Self
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
fn descend_bi(&self, op: Arc<dyn Fn(To) -> To>) -> Self
Biplate variant of [
Uniplate::descend
] Read more§fn universe_bi(&self) -> VecDeque<To>
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>
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
fn transform_bi(&self, op: Arc<dyn Fn(To) -> To>) -> Self
Applies the given function to all nodes bottom up. Read more
Source§impl Biplate<AbstractLiteral<Expression>> for Literal
impl Biplate<AbstractLiteral<Expression>> for Literal
Source§fn biplate(
&self,
) -> (Tree<AbstractLiteral<Expression>>, Box<dyn Fn(Tree<AbstractLiteral<Expression>>) -> Literal>)
fn biplate( &self, ) -> (Tree<AbstractLiteral<Expression>>, Box<dyn Fn(Tree<AbstractLiteral<Expression>>) -> Literal>)
Definition of a Biplate. Read more
§fn with_children_bi(&self, children: VecDeque<To>) -> Self
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
fn descend_bi(&self, op: Arc<dyn Fn(To) -> To>) -> Self
Biplate variant of [
Uniplate::descend
] Read more§fn universe_bi(&self) -> VecDeque<To>
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>
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
fn transform_bi(&self, op: Arc<dyn Fn(To) -> To>) -> Self
Applies the given function to all nodes bottom up. Read more
Source§impl Biplate<AbstractLiteral<Literal>> for Atom
impl Biplate<AbstractLiteral<Literal>> for Atom
Source§fn biplate(
&self,
) -> (Tree<AbstractLiteral<Literal>>, Box<dyn Fn(Tree<AbstractLiteral<Literal>>) -> Atom>)
fn biplate( &self, ) -> (Tree<AbstractLiteral<Literal>>, Box<dyn Fn(Tree<AbstractLiteral<Literal>>) -> Atom>)
Definition of a Biplate. Read more
§fn with_children_bi(&self, children: VecDeque<To>) -> Self
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
fn descend_bi(&self, op: Arc<dyn Fn(To) -> To>) -> Self
Biplate variant of [
Uniplate::descend
] Read more§fn universe_bi(&self) -> VecDeque<To>
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>
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
fn transform_bi(&self, op: Arc<dyn Fn(To) -> To>) -> Self
Applies the given function to all nodes bottom up. Read more
Source§impl Biplate<AbstractLiteral<Literal>> for Expression
impl Biplate<AbstractLiteral<Literal>> for Expression
Source§fn biplate(
&self,
) -> (Tree<AbstractLiteral<Literal>>, Box<dyn Fn(Tree<AbstractLiteral<Literal>>) -> Expression>)
fn biplate( &self, ) -> (Tree<AbstractLiteral<Literal>>, Box<dyn Fn(Tree<AbstractLiteral<Literal>>) -> Expression>)
Definition of a Biplate. Read more
§fn with_children_bi(&self, children: VecDeque<To>) -> Self
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
fn descend_bi(&self, op: Arc<dyn Fn(To) -> To>) -> Self
Biplate variant of [
Uniplate::descend
] Read more§fn universe_bi(&self) -> VecDeque<To>
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>
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
fn transform_bi(&self, op: Arc<dyn Fn(To) -> To>) -> Self
Applies the given function to all nodes bottom up. Read more
Source§impl Biplate<AbstractLiteral<Literal>> for Literal
impl Biplate<AbstractLiteral<Literal>> for Literal
Source§fn biplate(
&self,
) -> (Tree<AbstractLiteral<Literal>>, Box<dyn Fn(Tree<AbstractLiteral<Literal>>) -> Literal>)
fn biplate( &self, ) -> (Tree<AbstractLiteral<Literal>>, Box<dyn Fn(Tree<AbstractLiteral<Literal>>) -> Literal>)
Definition of a Biplate. Read more
§fn with_children_bi(&self, children: VecDeque<To>) -> Self
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
fn descend_bi(&self, op: Arc<dyn Fn(To) -> To>) -> Self
Biplate variant of [
Uniplate::descend
] Read more§fn universe_bi(&self) -> VecDeque<To>
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>
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
fn transform_bi(&self, op: Arc<dyn Fn(To) -> To>) -> Self
Applies the given function to all nodes bottom up. Read more
Source§impl<U, To> Biplate<To> for AbstractLiteral<U>where
To: Uniplate,
U: Biplate<To> + Biplate<U> + Biplate<AbstractLiteral<U>>,
impl<U, To> Biplate<To> for AbstractLiteral<U>where
To: Uniplate,
U: Biplate<To> + Biplate<U> + Biplate<AbstractLiteral<U>>,
Source§fn biplate(&self) -> (Tree<To>, Box<dyn Fn(Tree<To>) -> AbstractLiteral<U>>)
fn biplate(&self) -> (Tree<To>, Box<dyn Fn(Tree<To>) -> AbstractLiteral<U>>)
Definition of a Biplate. Read more
§fn with_children_bi(&self, children: VecDeque<To>) -> Self
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
fn descend_bi(&self, op: Arc<dyn Fn(To) -> To>) -> Self
Biplate variant of [
Uniplate::descend
] Read more§fn universe_bi(&self) -> VecDeque<To>
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>
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
fn transform_bi(&self, op: Arc<dyn Fn(To) -> To>) -> Self
Applies the given function to all nodes bottom up. Read more
Source§impl<T> Clone for AbstractLiteral<T>where
T: Clone + Uniplate + Biplate<AbstractLiteral<T>> + Biplate<T>,
impl<T> Clone for AbstractLiteral<T>where
T: Clone + Uniplate + Biplate<AbstractLiteral<T>> + Biplate<T>,
Source§fn clone(&self) -> AbstractLiteral<T>
fn clone(&self) -> AbstractLiteral<T>
Returns a copy 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<T> Debug for AbstractLiteral<T>where
T: Debug + Uniplate + Biplate<AbstractLiteral<T>> + Biplate<T>,
impl<T> Debug for AbstractLiteral<T>where
T: Debug + Uniplate + Biplate<AbstractLiteral<T>> + Biplate<T>,
Source§impl<'de, T> Deserialize<'de> for AbstractLiteral<T>where
T: Uniplate + Biplate<AbstractLiteral<T>> + Biplate<T> + Deserialize<'de>,
impl<'de, T> Deserialize<'de> for AbstractLiteral<T>where
T: Uniplate + Biplate<AbstractLiteral<T>> + Biplate<T> + Deserialize<'de>,
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<AbstractLiteral<T>, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<AbstractLiteral<T>, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl<T> Display for AbstractLiteral<T>where
T: Uniplate + Biplate<AbstractLiteral<T>> + Biplate<T> + Display,
impl<T> Display for AbstractLiteral<T>where
T: Uniplate + Biplate<AbstractLiteral<T>> + Biplate<T> + Display,
Source§impl Hash for AbstractLiteral<Literal>
impl Hash for AbstractLiteral<Literal>
Source§impl<T> PartialEq for AbstractLiteral<T>where
T: PartialEq + Uniplate + Biplate<AbstractLiteral<T>> + Biplate<T>,
impl<T> PartialEq for AbstractLiteral<T>where
T: PartialEq + Uniplate + Biplate<AbstractLiteral<T>> + Biplate<T>,
Source§impl<T> Serialize for AbstractLiteral<T>where
T: Uniplate + Biplate<AbstractLiteral<T>> + Biplate<T> + Serialize,
impl<T> Serialize for AbstractLiteral<T>where
T: Uniplate + Biplate<AbstractLiteral<T>> + Biplate<T> + Serialize,
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
Source§impl<T> Uniplate for AbstractLiteral<T>where
T: Uniplate + Biplate<AbstractLiteral<T>> + Biplate<T>,
impl<T> Uniplate for AbstractLiteral<T>where
T: Uniplate + Biplate<AbstractLiteral<T>> + Biplate<T>,
Source§fn uniplate(
&self,
) -> (Tree<AbstractLiteral<T>>, Box<dyn Fn(Tree<AbstractLiteral<T>>) -> AbstractLiteral<T>>)
fn uniplate( &self, ) -> (Tree<AbstractLiteral<T>>, Box<dyn Fn(Tree<AbstractLiteral<T>>) -> AbstractLiteral<T>>)
Definition of a
Uniplate
. Read more§fn descend(&self, op: Arc<dyn Fn(Self) -> Self>) -> Self
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>
fn universe(&self) -> VecDeque<Self>
Gets all children of a node, including itself and all children. Read more
§fn with_children(&self, children: VecDeque<Self>) -> Self
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
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
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
fn cata<T>(&self, op: Arc<dyn Fn(Self, VecDeque<T>) -> T>) -> T
Performs a fold-like computation on each value. Read more
impl<T> Eq for AbstractLiteral<T>where
T: Eq + Uniplate + Biplate<AbstractLiteral<T>> + Biplate<T>,
impl<T> StructuralPartialEq for AbstractLiteral<T>where
T: Uniplate + Biplate<AbstractLiteral<T>> + Biplate<T>,
Auto Trait Implementations§
impl<T> Freeze for AbstractLiteral<T>
impl<T> RefUnwindSafe for AbstractLiteral<T>where
T: RefUnwindSafe,
impl<T> Send for AbstractLiteral<T>where
T: Send,
impl<T> Sync for AbstractLiteral<T>where
T: Sync,
impl<T> Unpin for AbstractLiteral<T>where
T: Unpin,
impl<T> UnwindSafe for AbstractLiteral<T>where
T: 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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
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
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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