[][src]Struct sophia_term::blank_node::BlankNode

pub struct BlankNode<TD: TermData>(_);

An RDF blank node.

See module documentation for more detail.

Implementations

impl<TD> BlankNode<TD> where
    TD: TermData
[src]

pub fn new<U>(id: U) -> Result<Self> where
    U: AsRef<str>,
    TD: From<U>, 
[src]

Return a new blank node with the given identifier.

May fail if id is not a valid identifier according to BLANK_NODE_LABEL. This means that it must not include the typical leading _:.

pub fn new_unchecked<U>(id: U) -> Self where
    U: AsRef<str>,
    TD: From<U>, 
[src]

Return a new blank node with the given identifier.

Pre-condition

This function requires that id is a valid blank node identifier.

pub fn as_ref(&self) -> BlankNode<&TD>[src]

Borrow the inner contents of the blank node.

pub fn as_ref_str(&self) -> BlankNode<&str>[src]

Borrow the inner contents of the blank node as &str.

pub fn map<F, TD2>(self, f: F) -> BlankNode<TD2> where
    F: FnMut(TD) -> TD2,
    TD2: TermData
[src]

Create a new blank node by applying f to the TermData of self.

pub fn map_into<TD2>(self) -> BlankNode<TD2> where
    TD: Into<TD2>,
    TD2: TermData
[src]

Maps the blank node using the Into trait.

pub fn clone_map<'a, U, F>(&'a self, factory: F) -> BlankNode<U> where
    U: TermData,
    F: FnMut(&'a str) -> U, 
[src]

Clone self while transforming the inner TermData with the given factory.

This is done in one step in contrast to calling clone().map(factory).

pub fn clone_into<'src, U>(&'src self) -> BlankNode<U> where
    U: TermData + From<&'src str>, 
[src]

Apply clone_map() using the Into trait.

pub fn as_str(&self) -> &str[src]

Borrow the blank nodes ID.

Note: The ID does not have a leading _:.

pub fn write_fmt<W>(&self, w: &mut W) -> Result where
    W: Write
[src]

Writes the blank node to the fmt::Write using the N3 syntax.

pub fn write_io<W>(&self, w: &mut W) -> Result<()> where
    W: Write
[src]

Writes the blank node to the io::Write using the N3 syntax.

Trait Implementations

impl<TD: Clone + TermData> Clone for BlankNode<TD>[src]

impl<TD: Copy + TermData> Copy for BlankNode<TD>[src]

impl<TD: Debug + TermData> Debug for BlankNode<TD>[src]

impl<TD> Deref for BlankNode<TD> where
    TD: TermData
[src]

type Target = TD

The resulting type after dereferencing.

impl<TD> Display for BlankNode<TD> where
    TD: TermData
[src]

impl<TD: Eq + TermData> Eq for BlankNode<TD>[src]

impl<TD> From<BlankNode<TD>> for Term<TD> where
    TD: TermData
[src]

impl<TD> Hash for BlankNode<TD> where
    TD: TermData
[src]

impl<TD: Ord + TermData> Ord for BlankNode<TD>[src]

impl<TD, TE: ?Sized> PartialEq<TE> for BlankNode<TD> where
    TD: TermData,
    TE: TTerm
[src]

impl<TD, TE: ?Sized> PartialOrd<TE> for BlankNode<TD> where
    TD: TermData,
    TE: TTerm
[src]

impl<TD: TermData> StructuralEq for BlankNode<TD>[src]

impl<TD: TermData> TTerm for BlankNode<TD>[src]

impl<TD> TryCopyTerm for BlankNode<TD> where
    TD: TermData + for<'x> From<&'x str>, 
[src]

type Error = TermError

The error type produced when failing to copy a given term

impl<'a, T, U> TryFrom<&'a Term<U>> for BlankNode<T> where
    T: TermData + From<&'a str>,
    U: TermData
[src]

type Error = TermError

The type returned in the event of a conversion error.

impl<TD> TryFrom<Term<TD>> for BlankNode<TD> where
    TD: TermData
[src]

type Error = TermError

The type returned in the event of a conversion error.

Auto Trait Implementations

impl<TD> RefUnwindSafe for BlankNode<TD> where
    TD: RefUnwindSafe

impl<TD> Send for BlankNode<TD> where
    TD: Send

impl<TD> Sync for BlankNode<TD> where
    TD: Sync

impl<TD> Unpin for BlankNode<TD> where
    TD: Unpin

impl<TD> UnwindSafe for BlankNode<TD> where
    TD: UnwindSafe

Blanket Implementations

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

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

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

impl<T> ConvertibleTerm for T where
    T: TTerm + ?Sized
[src]

impl<T> CopiableTerm for T where
    T: TTerm + ?Sized
[src]

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

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

impl<U> TermMatcher for U where
    U: TTerm + ?Sized
[src]

type Term = U

Type of TTerm used internally by this matcher.

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

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[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.