Struct rdftk_core::literal::Literal[][src]

pub struct Literal { /* fields omitted */ }
Expand description

Implementations

impl Literal[src]

pub fn new(value: &str) -> Self[src]

Construct a new, untyped, literal value.

pub fn with_type(value: &str, data_type: DataType) -> Self[src]

Construct a new typed literal value.

pub fn with_language(value: &str, language: &str) -> Self[src]

Construct a new string literal value with the associated language.

pub fn string(value: &str) -> Self[src]

Construct a new DataType::String value.

pub fn qname(value: QName) -> Self[src]

Construct a new DataType::QName value.

pub fn iri(value: IRIRef) -> Self[src]

Construct a new DataType::IRI value.

pub fn boolean(value: bool) -> Self[src]

Construct a new DataType::Boolean value.

pub fn duration(value: Duration) -> Self[src]

Construct a new DataType::Duration value.

pub fn chrono_duration(value: Duration) -> Self[src]

Construct a new DataType::Duration value.

pub fn lexical_form(&self) -> &String[src]

Return the lexical form of this literal.

pub fn has_data_type(&self) -> bool[src]

Returns true if this literal has a specified data type, else false.

pub fn data_type(&self) -> &Option<DataType>[src]

Returns this literal’s data type, if present.

pub fn has_language(&self) -> bool[src]

Returns true if this literal has a specified language, else false.

pub fn language(&self) -> &Option<String>[src]

Returns this literal’s language, if present.

pub fn as_object(&self) -> ObjectNodeRef[src]

Create a new object node from this literal.

Trait Implementations

impl Clone for Literal[src]

fn clone(&self) -> Literal[src]

Returns a copy of the value. Read more

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

impl Debug for Literal[src]

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

Formats the value using the given formatter. Read more

impl Display for Literal[src]

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

Formats the value using the given formatter. Read more

impl From<&'_ str> for Literal[src]

fn from(value: &str) -> Self[src]

Performs the conversion.

impl From<Arc<IRI>> for Literal[src]

fn from(value: IRIRef) -> Self[src]

Performs the conversion.

impl From<Duration> for Literal[src]

fn from(value: Duration) -> Self[src]

Performs the conversion.

impl From<Duration> for Literal[src]

fn from(value: Duration) -> Self[src]

Performs the conversion.

impl From<Literal> for ObjectNodeRef[src]

fn from(v: Literal) -> Self[src]

Performs the conversion.

impl From<QName> for Literal[src]

fn from(value: QName) -> Self[src]

Performs the conversion.

impl From<String> for Literal[src]

fn from(value: String) -> Self[src]

Performs the conversion.

impl From<bool> for Literal[src]

fn from(value: bool) -> Self[src]

Performs the conversion.

impl From<f32> for Literal[src]

fn from(value: f32) -> Self[src]

Performs the conversion.

impl From<f64> for Literal[src]

fn from(value: f64) -> Self[src]

Performs the conversion.

impl From<i16> for Literal[src]

fn from(value: i16) -> Self[src]

Performs the conversion.

impl From<i32> for Literal[src]

fn from(value: i32) -> Self[src]

Performs the conversion.

impl From<i64> for Literal[src]

fn from(value: i64) -> Self[src]

Performs the conversion.

impl From<i8> for Literal[src]

fn from(value: i8) -> Self[src]

Performs the conversion.

impl From<u16> for Literal[src]

fn from(value: u16) -> Self[src]

Performs the conversion.

impl From<u32> for Literal[src]

fn from(value: u32) -> Self[src]

Performs the conversion.

impl From<u64> for Literal[src]

fn from(value: u64) -> Self[src]

Performs the conversion.

impl From<u8> for Literal[src]

fn from(value: u8) -> Self[src]

Performs the conversion.

impl Hash for Literal[src]

fn hash<__H: Hasher>(&self, state: &mut __H)[src]

Feeds this value into the given Hasher. Read more

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

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

impl PartialEq<Literal> for Literal[src]

fn eq(&self, other: &Literal) -> bool[src]

This method tests for self and other values to be equal, and is used by ==. Read more

fn ne(&self, other: &Literal) -> bool[src]

This method tests for !=.

impl Eq for Literal[src]

impl StructuralEq for Literal[src]

impl StructuralPartialEq for Literal[src]

Auto Trait Implementations

impl RefUnwindSafe for Literal

impl Send for Literal

impl Sync for Literal

impl Unpin for Literal

impl UnwindSafe for Literal

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

impl<T> From<T> for T[src]

pub fn from(t: T) -> T[src]

Performs the conversion.

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

pub fn into(self) -> U[src]

Performs the conversion.

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

pub fn to_owned(&self) -> T[src]

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

pub fn clone_into(&self, target: &mut T)[src]

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

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

impl<T> ToString for T where
    T: Display + ?Sized
[src]

pub default fn to_string(&self) -> String[src]

Converts the given value to a String. Read more

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]

Performs the conversion.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

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

Performs the conversion.