Struct BlankNode
pub struct BlankNode(BlankNodeContent);
rdf
only.Expand description
An owned RDF blank node.
The common way to create a new blank node is to use the BlankNode::default()
function.
It is also possible to create a blank node from a blank node identifier using the BlankNode::new()
function.
The blank node identifier must be valid according to N-Triples, Turtle, and SPARQL grammars.
The default string formatter is returning an N-Triples, Turtle, and SPARQL compatible representation:
use oxrdf::BlankNode;
assert_eq!("_:a122", BlankNode::new("a122")?.to_string());
Tuple Fieldsยง
ยง0: BlankNodeContent
Implementationsยง
ยงimpl BlankNode
impl BlankNode
pub fn new(id: impl Into<String>) -> Result<BlankNode, BlankNodeIdParseError>
pub fn new(id: impl Into<String>) -> Result<BlankNode, BlankNodeIdParseError>
Creates a blank node from a unique identifier.
The blank node identifier must be valid according to N-Triples, Turtle, and SPARQL grammars.
In most cases, it is much more convenient to create a blank node using BlankNode::default()
that creates a random ID that could be easily inlined by Oxigraph stores.
pub fn new_unchecked(id: impl Into<String>) -> BlankNode
pub fn new_unchecked(id: impl Into<String>) -> BlankNode
Creates a blank node from a unique identifier without validation.
It is the callerโs responsibility to ensure that id
is a valid blank node identifier
according to N-Triples, Turtle, and SPARQL grammars.
BlankNode::new()
is a safe version of this constructor and should be used for untrusted data.
pub fn new_from_unique_id(id: u128) -> BlankNode
pub fn new_from_unique_id(id: u128) -> BlankNode
Creates a blank node from a unique numerical id.
In most cases, it is much more convenient to create a blank node using BlankNode::default()
.
pub fn into_string(self) -> String
pub fn into_string(self) -> String
Returns the underlying ID of this blank node.
pub fn as_ref(&self) -> BlankNodeRef<'_>
Trait Implementationsยง
ยงimpl Default for BlankNode
impl Default for BlankNode
ยงfn default() -> BlankNode
fn default() -> BlankNode
Builds a new RDF blank node with a unique id.
ยงimpl<'a> From<&'a BlankNode> for GraphNameRef<'a>
impl<'a> From<&'a BlankNode> for GraphNameRef<'a>
ยงfn from(node: &'a BlankNode) -> GraphNameRef<'a>
fn from(node: &'a BlankNode) -> GraphNameRef<'a>
ยงimpl<'a> From<&'a BlankNode> for SubjectRef<'a>
impl<'a> From<&'a BlankNode> for SubjectRef<'a>
ยงfn from(node: &'a BlankNode) -> SubjectRef<'a>
fn from(node: &'a BlankNode) -> SubjectRef<'a>
ยงimpl FromStr for BlankNode
impl FromStr for BlankNode
impl Eq for BlankNode
impl StructuralPartialEq for BlankNode
Auto Trait Implementationsยง
impl Freeze for BlankNode
impl RefUnwindSafe for BlankNode
impl Send for BlankNode
impl Sync for BlankNode
impl Unpin for BlankNode
impl UnwindSafe for BlankNode
Blanket Implementationsยง
ยงimpl<T> ArchivePointee for T
impl<T> ArchivePointee for T
ยงtype ArchivedMetadata = ()
type ArchivedMetadata = ()
ยงfn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
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
ยงimpl<T> CallHasher for T
impl<T> CallHasher for T
Sourceยงimpl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
ยงimpl<F, W, T, D> Deserialize<With<T, W>, D> for F
impl<F, W, T, D> Deserialize<With<T, W>, D> for F
ยงfn deserialize(
&self,
deserializer: &mut D,
) -> Result<With<T, W>, <D as Fallible>::Error>
fn deserialize( &self, deserializer: &mut D, ) -> Result<With<T, W>, <D as Fallible>::Error>
ยงimpl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
ยงfn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
, which can then be
downcast
into Box<dyn ConcreteType>
where ConcreteType
implements Trait
.ยงfn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
, which can then be further
downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
.ยงfn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
โs vtable from &Trait
โs.ยงfn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
โs vtable from &mut Trait
โs.ยงimpl<T> DowncastSend for T
impl<T> DowncastSend for T
ยงimpl<T> DowncastSync for T
impl<T> DowncastSync for T
ยงimpl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
ยงfn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
ยงimpl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
ยงfn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.ยงimpl<T> Instrument for T
impl<T> Instrument for T
ยงfn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
ยงfn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Sourceยงimpl<T> IntoEither for T
impl<T> IntoEither for T
Sourceยงfn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSourceยงfn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more