pub enum Language {
Known(KnownLanguage),
Unknown(String),
}Expand description
A policy language, known to this build or not.
Variants§
Known(KnownLanguage)
A language this workspace names — see KnownLanguage.
Unknown(String)
A language this build does not recognize, carrying the string the
record named it with. Never coerced into a KnownLanguage and
never silently ignored — see this module’s doc comment for what a
loader does with it.
Implementations§
Source§impl Language
impl Language
Sourcepub fn parse(name: &str) -> Language
pub fn parse(name: &str) -> Language
Parse a policy record’s language string into this open union.
Case-sensitive, matching exactly the names a loader compares a
record’s language field against (see
didbot-policy-records::compile::Language::name). A name this build
does not recognize parses to Language::Unknown, never an error:
this function only classifies a name, it does not judge whether the
resulting language has a working evaluator behind it. See this
module’s doc comment for what a loader does with the result.
Trait Implementations§
impl Eq for Language
impl StructuralPartialEq for Language
Auto Trait Implementations§
impl Freeze for Language
impl RefUnwindSafe for Language
impl Send for Language
impl Sync for Language
impl Unpin for Language
impl UnsafeUnpin for Language
impl UnwindSafe for Language
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
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
§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
key and return true if they are equal.