pub struct OwlLiteral<Text = String>{ /* private fields */ }Expand description
A standard RDF literal with an exact UTF-8 lexical form.
Equality is RDF term equality, not datatype value equality. Ill-typed lexical forms are representable; evaluating datatype lexical spaces is a separate task.
Implementations§
Source§impl<Text> Literal<Text>
impl<Text> Literal<Text>
Sourcepub fn try_new(
lexical: Text,
metadata: LiteralMetadata<Text>,
) -> Result<Literal<Text>, ModelError>
pub fn try_new( lexical: Text, metadata: LiteralMetadata<Text>, ) -> Result<Literal<Text>, ModelError>
Validate standard RDF datatype/facet combinations without evaluating lexical values.
§Errors
Returns ModelError::InconsistentLiteralFacets for inconsistent
metadata.
Sourcepub const fn metadata(&self) -> &LiteralMetadata<Text>
pub const fn metadata(&self) -> &LiteralMetadata<Text>
Metadata accessible without copying the lexical payload.
Source§impl Literal
impl Literal
Sourcepub fn typed(
lexical: impl Into<String>,
datatype: Iri<String>,
) -> Result<Literal, ModelError>
pub fn typed( lexical: impl Into<String>, datatype: Iri<String>, ) -> Result<Literal, ModelError>
Construct a non-language typed literal.
§Errors
Language datatypes require their corresponding facets and are rejected here.
Sourcepub fn language_tagged(
lexical: impl Into<String>,
language: LanguageTag,
) -> Literal
pub fn language_tagged( lexical: impl Into<String>, language: LanguageTag, ) -> Literal
Construct a language-tagged literal from a validated tag.
Sourcepub fn directional(
lexical: impl Into<String>,
language: LanguageTag,
direction: BaseDirection,
) -> Literal
pub fn directional( lexical: impl Into<String>, language: LanguageTag, direction: BaseDirection, ) -> Literal
Construct a directional language-tagged literal from a validated tag.
Trait Implementations§
Source§impl<'de, Text> Deserialize<'de> for Literal<Text>
impl<'de, Text> Deserialize<'de> for Literal<Text>
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<Literal<Text>, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<Literal<Text>, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl<Text> Eq for Literal<Text>
Source§impl<Text> Serialize for Literal<Text>
impl<Text> Serialize for Literal<Text>
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
impl<Text> StructuralPartialEq for Literal<Text>
Auto Trait Implementations§
impl<Text> Freeze for Literal<Text>
impl<Text> RefUnwindSafe for Literal<Text>
impl<Text> Send for Literal<Text>
impl<Text> Sync for Literal<Text>
impl<Text> Unpin for Literal<Text>
impl<Text> UnsafeUnpin for Literal<Text>
impl<Text> UnwindSafe for Literal<Text>
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