Enum json_ld::Reference[][src]

pub enum Reference<T: AsIri = IriBuf> {
    Id(T),
    Blank(BlankId),
    Invalid(String),
}
Expand description

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.

Tuple Fields of Id

0: T
Blank(BlankId)

Blank node identifier.

Tuple Fields of Blank

0: BlankId
Invalid(String)

Invalid reference.

Tuple Fields of Invalid

0: String

Implementations

Checks if this is a valid reference.

Returns true is this reference is a node identifier or a blank node identifier, false otherwise.

Get a string representation of the reference.

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

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

Returns None if it is a blank node reference.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Formats the value using the given formatter. Read more

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Feeds this value into the given Hasher. Read more

Feeds a slice of this type into the given Hasher. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

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

Convert the value into a reference.

The type returned in the event of a conversion error.

Performs the conversion.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

Performs the conversion.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

Converts the given value to a String. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.