Trait rdftk_core::model::literal::LiteralFactory [−][src]
pub trait LiteralFactory: Debug + Provided {}Show methods
fn literal(&self, v: &str) -> LiteralRef; fn with_language(&self, v: &str, lang: LanguageTag) -> LiteralRef; fn with_data_type(&self, v: &str, data_type: DataType) -> LiteralRef; fn with_language_str(&self, v: &str, lang: &str) -> Result<LiteralRef> { ... } fn string(&self, v: &str) -> LiteralRef { ... } fn qname(&self, v: &str) -> LiteralRef { ... } fn uri(&self, v: &IRIRef) -> LiteralRef { ... } fn boolean(&self, v: bool) -> LiteralRef { ... } fn float(&self, v: f32) -> LiteralRef { ... } fn double(&self, v: f64) -> LiteralRef { ... } fn long(&self, v: i64) -> LiteralRef { ... } fn int(&self, v: i32) -> LiteralRef { ... } fn short(&self, v: i16) -> LiteralRef { ... } fn byte(&self, v: i8) -> LiteralRef { ... } fn unsigned_long(&self, v: u64) -> LiteralRef { ... } fn unsigned_int(&self, v: u32) -> LiteralRef { ... } fn unsigned_short(&self, v: u16) -> LiteralRef { ... } fn unsigned_byte(&self, v: u8) -> LiteralRef { ... } fn duration(&self, v: Duration) -> LiteralRef { ... } fn chrono_duration(&self, v: Duration) -> LiteralRef { ... }
Expand description
A value factory can be used to provide previously cached values rather than creating duplicates
within a graph. Such a factory may only be retrieved using the Graph::literal_factory
method.
Required methods
fn literal(&self, v: &str) -> LiteralRef
[src]
fn literal(&self, v: &str) -> LiteralRef
[src]Returns a cached untyped literal value with the provided string.
fn with_language(&self, v: &str, lang: LanguageTag) -> LiteralRef
[src]
fn with_language(&self, v: &str, lang: LanguageTag) -> LiteralRef
[src]Returns a cached literal value with the provided string and language.
fn with_data_type(&self, v: &str, data_type: DataType) -> LiteralRef
[src]
fn with_data_type(&self, v: &str, data_type: DataType) -> LiteralRef
[src]Returns a cached literal value with the provided string and data type.
Provided methods
fn with_language_str(&self, v: &str, lang: &str) -> Result<LiteralRef>
[src]
fn with_language_str(&self, v: &str, lang: &str) -> Result<LiteralRef>
[src]Returns a cached literal value with the provided string and language.
fn string(&self, v: &str) -> LiteralRef
[src]
fn string(&self, v: &str) -> LiteralRef
[src]Returns a cached literal value with the provided string.
fn qname(&self, v: &str) -> LiteralRef
[src]
fn qname(&self, v: &str) -> LiteralRef
[src]Returns a cached literal value with the provided QName.
fn uri(&self, v: &IRIRef) -> LiteralRef
[src]
fn uri(&self, v: &IRIRef) -> LiteralRef
[src]Returns a cached literal value with the provided IRI.
fn boolean(&self, v: bool) -> LiteralRef
[src]
fn boolean(&self, v: bool) -> LiteralRef
[src]Returns a cached literal value with the provided boolean.
fn float(&self, v: f32) -> LiteralRef
[src]
fn float(&self, v: f32) -> LiteralRef
[src]Returns a cached literal value with the provided float.
fn double(&self, v: f64) -> LiteralRef
[src]
fn double(&self, v: f64) -> LiteralRef
[src]Returns a cached literal value with the provided double.
fn long(&self, v: i64) -> LiteralRef
[src]
fn long(&self, v: i64) -> LiteralRef
[src]Returns a cached literal value with the provided long.
fn int(&self, v: i32) -> LiteralRef
[src]
fn int(&self, v: i32) -> LiteralRef
[src]Returns a cached literal value with the provided int.
fn short(&self, v: i16) -> LiteralRef
[src]
fn short(&self, v: i16) -> LiteralRef
[src]Returns a cached literal value with the provided short.
fn byte(&self, v: i8) -> LiteralRef
[src]
fn byte(&self, v: i8) -> LiteralRef
[src]Returns a cached literal value with the provided byte.
fn unsigned_long(&self, v: u64) -> LiteralRef
[src]
fn unsigned_long(&self, v: u64) -> LiteralRef
[src]Returns a cached literal value with the provided unsigned long.
fn unsigned_int(&self, v: u32) -> LiteralRef
[src]
fn unsigned_int(&self, v: u32) -> LiteralRef
[src]Returns a cached literal value with the provided unsigned int.
fn unsigned_short(&self, v: u16) -> LiteralRef
[src]
fn unsigned_short(&self, v: u16) -> LiteralRef
[src]Returns a cached literal value with the provided unsigned short.
fn unsigned_byte(&self, v: u8) -> LiteralRef
[src]
fn unsigned_byte(&self, v: u8) -> LiteralRef
[src]Returns a cached literal value with the provided unsigned byte.
fn duration(&self, v: Duration) -> LiteralRef
[src]
fn duration(&self, v: Duration) -> LiteralRef
[src]Returns a cached literal value with the provided duration.
fn chrono_duration(&self, v: Duration) -> LiteralRef
[src]
fn chrono_duration(&self, v: Duration) -> LiteralRef
[src]Returns a cached literal value with the provided duration.