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), a blank node identifier for local blank nodes or an invalid reference (a string that is neither an IRI nor blank node identifier).

Variants

Id(T)

Node identifier, essentially an IRI.

Blank(BlankId)

Blank node identifier.

Invalid(String)

Invalid reference.

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

Converts this value into a K JSON value using the given meta function to convert J::MetaData into K::MetaData. Read more

Converts this value into a K JSON value. Read more

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

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)

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.