[−][src]Struct json_ld::Indexed
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]
fn clone(&self) -> Self
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl<T> Deref for Indexed<T>
[src]
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]
fn hash<H: Hasher>(&self, h: &mut H)
[src]
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl<T: PartialEq> PartialEq<Indexed<T>> for Indexed<T>
[src]
Auto Trait Implementations
impl<T> RefUnwindSafe for Indexed<T> where
T: RefUnwindSafe,
T: RefUnwindSafe,
impl<T> Send for Indexed<T> where
T: Send,
T: Send,
impl<T> Sync for Indexed<T> where
T: Sync,
T: Sync,
impl<T> Unpin for Indexed<T> where
T: Unpin,
T: Unpin,
impl<T> UnwindSafe for Indexed<T> where
T: UnwindSafe,
T: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[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]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T> ToOwned for T
[src]
type Owned = T
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,