[][src]Struct json_ld::Indexed

pub struct Indexed<T> { /* fields omitted */ }

Indexed objects.

Nodes and value objects may be indexed by a string in JSON-LD. This type is a wrapper around any kind of indexable data.

It is a pointer type that Deref into the underlying value.

Methods

impl<T> Indexed<T>[src]

pub fn new(value: T, index: Option<String>) -> Indexed<T>[src]

Create a new (maybe) indexed value.

pub fn inner(&self) -> &T[src]

Get a reference to the inner value.

pub fn into_inner(self) -> T[src]

Drop the index and return the underlying value.

pub fn index(&self) -> Option<&str>[src]

Get the index, if any.

pub fn set_index(&mut self, index: Option<String>)[src]

Set the value index.

pub fn into_parts(self) -> (T, Option<String>)[src]

Turn this indexed value into its components: inner value and index.

pub fn cast<U: From<T>>(self) -> Indexed<U>[src]

Cast the inner value.

pub fn try_cast<U: TryFrom<T>>(self) -> Result<Indexed<U>, Indexed<U::Error>>[src]

Try to cast the inner value.

Trait Implementations

impl<T: AsJson> AsJson for Indexed<T>[src]

impl<T> AsMut<T> for Indexed<T>[src]

impl<T> AsRef<T> for Indexed<T>[src]

impl<T: Clone> Clone for Indexed<T>[src]

impl<T> Deref for Indexed<T>[src]

type Target = T

The resulting type after dereferencing.

impl<T> DerefMut for Indexed<T>[src]

impl<T: Eq> Eq for Indexed<T>[src]

impl<T: Id> From<Indexed<Object<T>>> for Expanded<T>[src]

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

impl<T: Hash> Hash for Indexed<T>[src]

impl<T: PartialEq> PartialEq<Indexed<T>> for Indexed<T>[src]

Auto Trait Implementations

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

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

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

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

impl<T> UnwindSafe for Indexed<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, 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.