Skip to main content

OwlLiteral

Struct OwlLiteral 

Source
pub struct OwlLiteral<Text = String>
where Text: Bos<str> + AsRef<str>,
{ /* 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>
where Text: Bos<str> + AsRef<str>,

Source

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.

Source

pub fn lexical(&self) -> &str

The exact lexical form, without value normalization.

Source

pub const fn metadata(&self) -> &LiteralMetadata<Text>

Metadata accessible without copying the lexical payload.

Source§

impl Literal

Source

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.

Source

pub fn string(lexical: impl Into<String>) -> Literal

Construct an XML Schema string literal.

Source

pub fn language_tagged( lexical: impl Into<String>, language: LanguageTag, ) -> Literal

Construct a language-tagged literal from a validated tag.

Source

pub fn directional( lexical: impl Into<String>, language: LanguageTag, direction: BaseDirection, ) -> Literal

Construct a directional language-tagged literal from a validated tag.

Source

pub fn as_ref(&self) -> Literal<&str>

Borrow the lexical form and metadata without copying their text.

Trait Implementations§

Source§

impl<Text> Clone for Literal<Text>
where Text: Clone + Bos<str> + AsRef<str>,

Source§

fn clone(&self) -> Literal<Text>

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<Text> Debug for Literal<Text>
where Text: Debug + Bos<str> + AsRef<str>,

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
Source§

impl<'de, Text> Deserialize<'de> for Literal<Text>
where Text: Bos<str> + AsRef<str> + Deserialize<'de>, Iri<Text>: Deserialize<'de>,

Source§

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
Source§

impl<Text> Eq for Literal<Text>
where Text: Eq + Bos<str> + AsRef<str>,

Source§

impl<Text> Hash for Literal<Text>
where Text: Hash + Bos<str> + AsRef<str>,

Source§

fn hash<__H>(&self, state: &mut __H)
where __H: Hasher,

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl<Text> PartialEq for Literal<Text>
where Text: PartialEq + Bos<str> + AsRef<str>,

Source§

fn eq(&self, other: &Literal<Text>) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl<Text> Serialize for Literal<Text>
where Text: Bos<str> + AsRef<str> + Serialize,

Source§

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
Source§

impl<Text> StructuralPartialEq for Literal<Text>
where Text: PartialEq + Bos<str> + AsRef<str>,

Source§

impl<Text> TryFrom<LiteralInput<Text>> for Literal<Text>
where Text: Bos<str> + AsRef<str>,

Source§

type Error = ModelError

The type returned in the event of a conversion error.
Source§

fn try_from( input: LiteralInput<Text>, ) -> Result<Literal<Text>, <Literal<Text> as TryFrom<LiteralInput<Text>>>::Error>

Performs the conversion.

Auto Trait Implementations§

§

impl<Text> Freeze for Literal<Text>
where Text: Freeze, LiteralMetadata<Text>: Freeze,

§

impl<Text> RefUnwindSafe for Literal<Text>

§

impl<Text> Send for Literal<Text>
where Text: Send, LiteralMetadata<Text>: Send,

§

impl<Text> Sync for Literal<Text>
where Text: Sync, LiteralMetadata<Text>: Sync,

§

impl<Text> Unpin for Literal<Text>
where Text: Unpin, LiteralMetadata<Text>: Unpin,

§

impl<Text> UnsafeUnpin for Literal<Text>

§

impl<Text> UnwindSafe for Literal<Text>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.