[][src]Struct json_ld::BlankId

pub struct BlankId(_);

Blank node identifier.

Blank nodes are non-uniquely identified nodes that are local to a JSON-LD document.

{
  "@id": "_:node1",
  "name": "Local blank node 1",
  "knows": {
  	"name": "Local blank node 2, that needs to refer to local node 1",
  	"knows": { "@id": "_:node1" }
  }
}

This type represent a blank node identifier of the form _:name. It is used by the Reference type to reference blank and non-blank nodes.

Methods

impl BlankId[src]

pub fn new(name: &str) -> BlankId[src]

Create a new blank identifier from a given name.

The created blank node will be of the form _:name.

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

Get the blank identifier as a string.

This includes the _: prefix. Use BlankId::name to get the suffix part only.

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

Get the name/suffix part of the identifier.

For a blank identifier _:name, this returns a string slice to name.

Trait Implementations

impl AsJson for BlankId[src]

fn as_json(&self) -> JsonValue[src]

Returns a JSON string of the form _:name.

impl Clone for BlankId[src]

impl Debug for BlankId[src]

impl Display for BlankId[src]

impl Eq for BlankId[src]

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

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

impl Hash for BlankId[src]

impl PartialEq<BlankId> for BlankId[src]

impl StructuralEq for BlankId[src]

impl StructuralPartialEq for BlankId[src]

impl<'a> TryFrom<&'a str> for BlankId[src]

type Error = ()

The type returned in the event of a conversion error.

Auto Trait Implementations

impl RefUnwindSafe for BlankId

impl Send for BlankId

impl Sync for BlankId

impl Unpin for BlankId

impl UnwindSafe for BlankId

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<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.