[][src]Enum json_ld::Reference

pub enum Reference<T: Id = IriBuf> {
    Id(T),
    Blank(BlankId),
}

Node reference.

Used to reference a node across a document or to a remote document. It can be an identifier (IRI) or a blank node identifier for local blank nodes.

Variants

Id(T)

Node identifier, essentially an IRI.

Blank(BlankId)

Blank node identifier.

Methods

impl<T: Id> Reference<T>[src]

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

Get a string representation of the reference.

This will either return a string slice of an IRI, or a blank node identifier.

pub fn as_iri(&self) -> Option<Iri>[src]

If the renference is a node identifier, returns the node IRI.

Returns None if it is a blank node reference.

Trait Implementations

impl<T: Id> AsJson for Reference<T>[src]

impl<T: Clone + Id> Clone for Reference<T>[src]

impl<T: Debug + Id> Debug for Reference<T>[src]

impl<T: Id> Display for Reference<T>[src]

impl<T: Eq + Id> Eq for Reference<T>[src]

impl<T: Id> From<BlankId> for Reference<T>[src]

impl<T: Id> From<Reference<T>> for Term<T>[src]

impl<T: Id> From<T> for Reference<T>[src]

impl<T: Hash + Id> Hash for Reference<T>[src]

impl<T: PartialEq + Id> PartialEq<Reference<T>> for Reference<T>[src]

impl<T: Id + PartialEq> PartialEq<T> for Reference<T>[src]

impl<V: Vocab> PartialEq<V> for Reference<Lexicon<V>>[src]

impl<T: Id> StructuralEq for Reference<T>[src]

impl<T: Id> StructuralPartialEq for Reference<T>[src]

impl<T: Id> TermLike for Reference<T>[src]

impl<'a, T: Id> ToReference<T> for &'a Reference<T>[src]

type Reference = &'a Reference<T>

The target type of the convertion, which can be borrowed as a Reference<T>.

impl<T: Id> TryFrom<Term<T>> for Reference<T>[src]

type Error = Term<T>

The type returned in the event of a conversion error.

Auto Trait Implementations

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

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

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

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

impl<T> UnwindSafe for Reference<T> where
    T: 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> From<!> for T[src]

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

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

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

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToOwned for T[src]

type Owned = T

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.