pub struct Declaration { /* private fields */ }
Implementations§
Source§impl Declaration
impl Declaration
Sourcepub fn new(name: Name, kind: DeclarationKind) -> Declaration
pub fn new(name: Name, kind: DeclarationKind) -> Declaration
Creates a new declaration.
Sourcepub fn new_var(name: Name, domain: Domain) -> Declaration
pub fn new_var(name: Name, domain: Domain) -> Declaration
Creates a new decision variable declaration.
Sourcepub fn new_domain_letting(name: Name, domain: Domain) -> Declaration
pub fn new_domain_letting(name: Name, domain: Domain) -> Declaration
Creates a new domain letting declaration.
Sourcepub fn new_value_letting(name: Name, value: Expression) -> Declaration
pub fn new_value_letting(name: Name, value: Expression) -> Declaration
Creates a new value letting declaration.
Sourcepub fn kind(&self) -> &DeclarationKind
pub fn kind(&self) -> &DeclarationKind
The kind of this declaration.
Sourcepub fn as_var(&self) -> Option<&DecisionVariable>
pub fn as_var(&self) -> Option<&DecisionVariable>
This declaration as a decision variable, if it is one.
Sourcepub fn as_var_mut(&mut self) -> Option<&mut DecisionVariable>
pub fn as_var_mut(&mut self) -> Option<&mut DecisionVariable>
This declaration as a mutable decision variable, if it is one.
Sourcepub fn as_domain_letting(&self) -> Option<&Domain>
pub fn as_domain_letting(&self) -> Option<&Domain>
This declaration as a domain letting, if it is one.
Sourcepub fn as_domain_letting_mut(&mut self) -> Option<&mut Domain>
pub fn as_domain_letting_mut(&mut self) -> Option<&mut Domain>
This declaration as a mutable domain letting, if it is one.
Sourcepub fn as_value_letting(&self) -> Option<&Expression>
pub fn as_value_letting(&self) -> Option<&Expression>
This declaration as a value letting, if it is one.
Sourcepub fn as_value_letting_mut(&mut self) -> Option<&mut Expression>
pub fn as_value_letting_mut(&mut self) -> Option<&mut Expression>
This declaration as a mutable value letting, if it is one.
Trait Implementations§
Source§impl Biplate<Declaration> for Declaration
impl Biplate<Declaration> for Declaration
Source§fn biplate(
&self,
) -> (Tree<Declaration>, Box<dyn Fn(Tree<Declaration>) -> Declaration>)
fn biplate( &self, ) -> (Tree<Declaration>, Box<dyn Fn(Tree<Declaration>) -> Declaration>)
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<Declaration> for DeclarationKind
impl Biplate<Declaration> for DeclarationKind
Source§fn biplate(
&self,
) -> (Tree<Declaration>, Box<dyn Fn(Tree<Declaration>) -> DeclarationKind>)
fn biplate( &self, ) -> (Tree<Declaration>, Box<dyn Fn(Tree<Declaration>) -> DeclarationKind>)
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<Expression> for Declaration
impl Biplate<Expression> for Declaration
Source§fn biplate(
&self,
) -> (Tree<Expression>, Box<dyn Fn(Tree<Expression>) -> Declaration>)
fn biplate( &self, ) -> (Tree<Expression>, Box<dyn Fn(Tree<Expression>) -> Declaration>)
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 Clone for Declaration
impl Clone for Declaration
Source§fn clone(&self) -> Declaration
fn clone(&self) -> Declaration
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 Debug for Declaration
impl Debug for Declaration
Source§impl DefaultWithId for Declaration
impl DefaultWithId for Declaration
Source§fn default_with_id(id: u32) -> Declaration
fn default_with_id(id: u32) -> Declaration
Creates a new default value of type
T
, but with the given id.Source§impl<'de> Deserialize<'de> for Declaration
impl<'de> Deserialize<'de> for Declaration
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<Declaration, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<Declaration, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for Declaration
impl PartialEq for Declaration
Source§impl Serialize for Declaration
impl Serialize for Declaration
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 Typeable for Declaration
impl Typeable for Declaration
fn return_type(&self) -> Option<ReturnType>
Source§impl Uniplate for Declaration
impl Uniplate for Declaration
Source§fn uniplate(
&self,
) -> (Tree<Declaration>, Box<dyn Fn(Tree<Declaration>) -> Declaration>)
fn uniplate( &self, ) -> (Tree<Declaration>, Box<dyn Fn(Tree<Declaration>) -> Declaration>)
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 Eq for Declaration
Auto Trait Implementations§
impl Freeze for Declaration
impl !RefUnwindSafe for Declaration
impl !Send for Declaration
impl !Sync for Declaration
impl Unpin for Declaration
impl !UnwindSafe for Declaration
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