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 duplicate 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<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 BTreeSet<&'a IdentifierReference>)
fn referenced_annotations<'a>( &'a self, names: &mut BTreeSet<&'a IdentifierReference>, )
Source§impl Serialize for ControlledLanguageString
impl Serialize for ControlledLanguageString
Source§impl Validate for ControlledLanguageString
impl Validate for ControlledLanguageString
fn validate( &self, _top: &Module, _cache: &impl ModuleStore, _loader: &impl ModuleLoader, _check_constraints: bool, )
Auto Trait Implementations§
impl Freeze for ControlledLanguageString
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