pub enum LiteralTypeRef<'a> {
Any(DatatypeRef<'a>),
LangString(&'a LangTag),
DirLangString {
tag: &'a LangTag,
direction: Direction,
},
}Expand description
RDF literal type reference.
Read-only counterpart of LiteralType. The Any variant wraps a
validated DatatypeRef so safe construction cannot produce a
LiteralTypeRef::Any(rdf:langString) or
LiteralTypeRef::Any(rdf:dirLangString).
Variants§
Any(DatatypeRef<'a>)
Typed literal datatype.
LangString(&'a LangTag)
Language-tagged literal with no base direction.
DirLangString
Directional language-tagged literal (RDF 1.2).
Implementations§
Source§impl<'a> LiteralTypeRef<'a>
impl<'a> LiteralTypeRef<'a>
Sourcepub const fn is_lang_string(&self) -> bool
pub const fn is_lang_string(&self) -> bool
Returns true for both Self::LangString and Self::DirLangString.
Sourcepub const fn is_undirected_lang_string(&self) -> bool
pub const fn is_undirected_lang_string(&self) -> bool
Returns true only for Self::LangString (no direction).
Sourcepub const fn is_dir_lang_string(&self) -> bool
pub const fn is_dir_lang_string(&self) -> bool
Returns true for Self::DirLangString (RDF 1.2).
pub const fn lang_tag(&self) -> Option<&'a LangTag>
Sourcepub const fn direction(&self) -> Option<Direction>
pub const fn direction(&self) -> Option<Direction>
Returns the base direction for Self::DirLangString only.
pub fn is_xsd_string(&self) -> bool
pub fn is_iri<T: Deref<Target = str>>(&self, iri: &Iri<T>) -> bool
Source§impl LiteralTypeRef<'_>
impl LiteralTypeRef<'_>
pub fn into_owned(self) -> LiteralType
Trait Implementations§
Source§impl<'a> Clone for LiteralTypeRef<'a>
impl<'a> Clone for LiteralTypeRef<'a>
impl<'a> Copy for LiteralTypeRef<'a>
Source§impl<'a> Debug for LiteralTypeRef<'a>
impl<'a> Debug for LiteralTypeRef<'a>
impl<'a> Eq for LiteralTypeRef<'a>
Source§impl<'a> From<&'a LangTag> for LiteralTypeRef<'a>
impl<'a> From<&'a LangTag> for LiteralTypeRef<'a>
Source§impl<'a> From<DatatypeRef<'a>> for LiteralTypeRef<'a>
impl<'a> From<DatatypeRef<'a>> for LiteralTypeRef<'a>
Source§fn from(value: DatatypeRef<'a>) -> Self
fn from(value: DatatypeRef<'a>) -> Self
Converts to this type from the input type.
Source§impl<'a> From<LiteralTypeRef<'a>> for CowLiteralType<'a>
impl<'a> From<LiteralTypeRef<'a>> for CowLiteralType<'a>
Source§fn from(value: LiteralTypeRef<'a>) -> Self
fn from(value: LiteralTypeRef<'a>) -> Self
Converts to this type from the input type.
Source§impl<'a> Hash for LiteralTypeRef<'a>
impl<'a> Hash for LiteralTypeRef<'a>
Source§impl<'a> Ord for LiteralTypeRef<'a>
impl<'a> Ord for LiteralTypeRef<'a>
Source§fn cmp(&self, other: &LiteralTypeRef<'a>) -> Ordering
fn cmp(&self, other: &LiteralTypeRef<'a>) -> Ordering
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl<'a> PartialEq for LiteralTypeRef<'a>
impl<'a> PartialEq for LiteralTypeRef<'a>
Source§impl PartialEq<LiteralType> for LiteralTypeRef<'_>
impl PartialEq<LiteralType> for LiteralTypeRef<'_>
Source§impl<'a> PartialEq<LiteralTypeRef<'a>> for LiteralType
impl<'a> PartialEq<LiteralTypeRef<'a>> for LiteralType
Source§impl<'a> PartialOrd for LiteralTypeRef<'a>
impl<'a> PartialOrd for LiteralTypeRef<'a>
Source§impl PartialOrd<LiteralType> for LiteralTypeRef<'_>
impl PartialOrd<LiteralType> for LiteralTypeRef<'_>
Source§impl<'a> PartialOrd<LiteralTypeRef<'a>> for LiteralType
impl<'a> PartialOrd<LiteralTypeRef<'a>> for LiteralType
Source§impl RdfDisplay for LiteralTypeRef<'_>
impl RdfDisplay for LiteralTypeRef<'_>
Source§fn rdf_fmt(&self, f: &mut Formatter<'_>) -> Result
fn rdf_fmt(&self, f: &mut Formatter<'_>) -> Result
Formats the value using the given formatter.
Source§fn rdf_display(&self) -> RdfDisplayed<&Self>
fn rdf_display(&self) -> RdfDisplayed<&Self>
Prepare the value to be formatted as an RDF syntax element.
Source§impl<'a> Serialize for LiteralTypeRef<'a>
impl<'a> Serialize for LiteralTypeRef<'a>
impl<'a> StructuralPartialEq for LiteralTypeRef<'a>
Auto Trait Implementations§
impl<'a> Freeze for LiteralTypeRef<'a>
impl<'a> RefUnwindSafe for LiteralTypeRef<'a>
impl<'a> Send for LiteralTypeRef<'a>
impl<'a> Sync for LiteralTypeRef<'a>
impl<'a> Unpin for LiteralTypeRef<'a>
impl<'a> UnsafeUnpin for LiteralTypeRef<'a>
impl<'a> UnwindSafe for LiteralTypeRef<'a>
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,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.