Struct sdml_core::model::constraints::ControlledLanguageString
source · pub struct ControlledLanguageString { /* private fields */ }
Expand description
Corresponds to the grammar rule informal_constraint
.
This structure captures an informal, or semi-formal constraint as a natural language string string.
"some cars have manual transmissions"
is an informal constraint in some unidentified natural language."some cars have manual transmissions"@en
is an informal constraint in English."there is a car that has a a:manual transmission."@en-ACE
is a semi-formal constraint in Attempto Controlled English (ACE).
We classify the last example as semi-formal, even though ACE is formally defined,
because SDML does not expect (although does not prohibit) the translation from this form into
the logical structure of a [ConstraintSentence
].
In the last example above the prefix a:
on manual identifies the term manual it as an
adjective applied to the word term transmission.
Implementations§
source§impl ControlledLanguageString
impl ControlledLanguageString
pub fn new<S>(value: S, language: ControlledLanguageTag) -> Self
pub const fn value(&self) -> &String
pub fn set_value(&mut self, value: String)
pub const fn has_language(&self) -> bool
pub const fn language(&self) -> Option<&ControlledLanguageTag>
pub fn set_language(&mut self, language: ControlledLanguageTag)
pub fn unset_language(&mut self)
Trait Implementations§
source§impl Clone for ControlledLanguageString
impl Clone for ControlledLanguageString
source§fn clone(&self) -> ControlledLanguageString
fn clone(&self) -> ControlledLanguageString
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 ControlledLanguageString
impl Debug for ControlledLanguageString
source§impl<'de> Deserialize<'de> for ControlledLanguageString
impl<'de> Deserialize<'de> for ControlledLanguageString
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<String> for ControlledLanguageString
impl From<String> for ControlledLanguageString
source§impl HasSourceSpan for ControlledLanguageString
impl HasSourceSpan for ControlledLanguageString
fn with_source_span(self, span: Span) -> Self
fn source_span(&self) -> Option<&Span>
fn set_source_span(&mut self, span: Span)
fn unset_source_span(&mut self)
fn has_source_span(&self) -> bool
source§impl References for ControlledLanguageString
impl References for ControlledLanguageString
fn referenced_types<'a>(&'a self, names: &mut HashSet<&'a IdentifierReference>)
fn referenced_annotations<'a>( &'a self, names: &mut HashSet<&'a IdentifierReference> )
source§impl Serialize for ControlledLanguageString
impl Serialize for ControlledLanguageString
source§impl Validate for ControlledLanguageString
impl Validate for ControlledLanguageString
Auto Trait Implementations§
impl RefUnwindSafe for ControlledLanguageString
impl Send for ControlledLanguageString
impl Sync for ControlledLanguageString
impl Unpin for ControlledLanguageString
impl UnwindSafe for ControlledLanguageString
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