Enum sdml_core::model::constraints::ConstraintBody
source · pub enum ConstraintBody {
Informal(ControlledLanguageString),
Formal(FormalConstraint),
}
Expand description
Corresponds to the field body
in the grammar rule constraint
.
Semantics
The domain of discourse, $\mathbb{D}$, is the set of all definitions present in the current module and the set of modules transitively imported by it.
Variants§
Informal(ControlledLanguageString)
Corresponds to the grammar rule informal_constraint
.
Formal(FormalConstraint)
Corresponds to the grammar rule formal_constraint
.
Implementations§
source§impl ConstraintBody
impl ConstraintBody
pub const fn is_informal(&self) -> bool
pub const fn as_informal(&self) -> Option<&ControlledLanguageString>
pub const fn is_formal(&self) -> bool
pub const fn as_formal(&self) -> Option<&FormalConstraint>
Trait Implementations§
source§impl Clone for ConstraintBody
impl Clone for ConstraintBody
source§fn clone(&self) -> ConstraintBody
fn clone(&self) -> ConstraintBody
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 ConstraintBody
impl Debug for ConstraintBody
source§impl<'de> Deserialize<'de> for ConstraintBody
impl<'de> Deserialize<'de> for ConstraintBody
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
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 From<ControlledLanguageString> for ConstraintBody
impl From<ControlledLanguageString> for ConstraintBody
source§fn from(v: ControlledLanguageString) -> Self
fn from(v: ControlledLanguageString) -> Self
Converts to this type from the input type.
source§impl From<FormalConstraint> for ConstraintBody
impl From<FormalConstraint> for ConstraintBody
source§fn from(v: FormalConstraint) -> Self
fn from(v: FormalConstraint) -> Self
Converts to this type from the input type.
source§impl HasBody<ConstraintBody> for Constraint
impl HasBody<ConstraintBody> for Constraint
source§fn body(&self) -> &ConstraintBody
fn body(&self) -> &ConstraintBody
Get the body of the enclosing type.
source§fn set_body(&mut self, body: ConstraintBody)
fn set_body(&mut self, body: ConstraintBody)
Set the body of the enclosing type.
source§impl References for ConstraintBody
impl References for ConstraintBody
fn referenced_annotations<'a>( &'a self, names: &mut HashSet<&'a IdentifierReference> )
fn referenced_types<'a>(&'a self, names: &mut HashSet<&'a IdentifierReference>)
source§impl Serialize for ConstraintBody
impl Serialize for ConstraintBody
source§impl Validate for ConstraintBody
impl Validate for ConstraintBody
Auto Trait Implementations§
impl RefUnwindSafe for ConstraintBody
impl Send for ConstraintBody
impl Sync for ConstraintBody
impl Unpin for ConstraintBody
impl UnwindSafe for ConstraintBody
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