[][src]Struct sophia::term::BNodeId

pub struct BNodeId<T: AsRef<str>> { /* fields omitted */ }

Internal representation of a blank node identifier.

May be encountered when pattern-matching on Terms of the BNode variant. For that purpose, note that BNodeId

  • derefs implicitly to its internal type T;
  • can be directly compared to a &str with the == operator.

Example :

use sophia::term::*;

fn is_foobar(t: BoxTerm) -> bool {
    match t {
        BNode(id) =>
            id.starts_with("foo") || id == "bar",
        _ =>
            false,
    }
}

See module documentation for more detail.

Methods

impl<T> BNodeId<T> where
    T: AsRef<str>, 
[src]

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

Whether this blank node identifier is compatible with the N3 family of syntaxes (N-Triples, Turtle...). This can be useful for serializers.

Trait Implementations

impl<T: Clone + AsRef<str>> Clone for BNodeId<T>[src]

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

Performs copy-assignment from source. Read more

impl<T> AsRef<str> for BNodeId<T> where
    T: AsRef<str>, 
[src]

impl<T, U> PartialEq<BNodeId<U>> for BNodeId<T> where
    T: AsRef<str>,
    U: AsRef<str>, 
[src]

#[must_use] fn ne(&self, other: &Rhs) -> bool1.0.0[src]

This method tests for !=.

impl<'a, T> PartialEq<&'a str> for BNodeId<T> where
    T: AsRef<str>, 
[src]

#[must_use] fn ne(&self, other: &Rhs) -> bool1.0.0[src]

This method tests for !=.

impl<T: Copy + AsRef<str>> Copy for BNodeId<T>[src]

impl<T: Eq + AsRef<str>> Eq for BNodeId<T>[src]

impl<T: Debug + AsRef<str>> Debug for BNodeId<T>[src]

impl<T> Deref for BNodeId<T> where
    T: AsRef<str>, 
[src]

type Target = T

The resulting type after dereferencing.

impl<T> Hash for BNodeId<T> where
    T: AsRef<str>, 
[src]

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

Auto Trait Implementations

impl<T> Sync for BNodeId<T> where
    T: Sync

impl<T> Send for BNodeId<T> where
    T: Send

impl<T> Unpin for BNodeId<T> where
    T: Unpin

impl<T> RefUnwindSafe for BNodeId<T> where
    T: RefUnwindSafe

impl<T> UnwindSafe for BNodeId<T> where
    T: UnwindSafe

Blanket Implementations

impl<T> TermData for T where
    T: AsRef<str> + Clone + Eq + Hash
[src]

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

type Owned = T

The resulting type after obtaining ownership.

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

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

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.

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.

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

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

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