Struct json_ld_syntax::Entry

source ·
pub struct Entry<T, M> {
    pub key_metadata: M,
    pub value: Meta<T, M>,
}

Fields§

§key_metadata: M§value: Meta<T, M>

Implementations§

source§

impl<T, M> Entry<T, M>

source

pub fn new(key_metadata: M, value: Meta<T, M>) -> Self

source

pub fn as_value(&self) -> &Meta<T, M>

source

pub fn into_value(self) -> Meta<T, M>

source

pub fn borrow_value(&self) -> Entry<&T, M>where M: Clone,

source

pub fn map<U>(self, f: impl Fn(T) -> U) -> Entry<U, M>

source

pub fn cast<U: From<T>>(self) -> Entry<U, M>

source§

impl<'a, T, M> Entry<&'a T, M>

source

pub fn into_deref(self) -> Entry<&'a T::Target, M>where T: Deref,

source§

impl<T, M> Entry<T, M>

source

pub fn insert_in_json_object( self, object: &mut Object<M>, key: Key ) -> Option<RemovedByInsertion<'_, M>>where T: IntoJsonMeta<M>,

Methods from Deref<Target = Meta<T, M>>§

source

pub fn location(&self) -> &Location<F, S>

Returns a reference to the value’s location.

source

pub fn location_mut(&mut self) -> &mut Location<F, S>

Returns a mutable reference to the value’s location.

source

pub fn span(&self) -> Swhere S: Clone,

Returns the value’s span.

source

pub fn span_mut(&mut self) -> &mut S

Returns a mutable reference the value’s span.

source

pub fn set_span(&mut self, span: S) -> S

Sets the value’s span and returns the previous one.

source

pub fn file(&self) -> &F

Returns a reference to the value’s source file.

source

pub fn file_mut(&mut self) -> &mut F

Returns a mutable reference to the value’s source file.

source

pub fn set_file(&mut self, file: F) -> F

Sets the value’s file and returns the previous one.

source

pub fn borrow_value_and_file(&self) -> Meta<&T, Location<&F, S>>where T: Clone, S: Clone,

Borrows the file and clones the value.

source

pub fn borrow_file(&self) -> Meta<T, Location<&F, S>>where T: Clone, S: Clone,

Borrows the file and clones the value.

source

pub fn cloned_file(&self) -> Meta<T, Location<F, S>>where T: Clone,

Clones the value and the borrowed file to return a new Loc<T, F>.

source

pub fn cloned(&self) -> Meta<T, Location<F, S>>

Clones the borrowed value and file to return a new Loc<T, F>.

source

pub fn value(&self) -> &T

Returns a reference to the wrapped value.

source

pub fn value_mut(&mut self) -> &mut T

Returns a mutable reference to the wrapped value.

source

pub fn metadata(&self) -> &M

Returns a reference to the value’s metadata.

source

pub fn metadata_mut(&mut self) -> &mut M

Returns a mutable reference to the value’s metadata.

source

pub fn borrow(&self) -> Meta<&T, &M>

Borrows the value and its metadata.

source

pub fn borrow_value(&self) -> Meta<&T, M>where M: Clone,

Borrows the value and clones the metadata.

source

pub fn borrow_metadata(&self) -> Meta<T, &M>where T: Clone,

Borrows the file and clones the value.

source

pub fn cloned(&self) -> Meta<T, M>

source

pub fn cloned_value(&self) -> Meta<T, M>where M: Clone,

Clones the borrowed value and the file to return a new Meta<T, F>.

source

pub fn cloned_metadata(&self) -> Meta<T, M>where T: Clone,

Trait Implementations§

source§

impl<T: Clone, M: Clone> Clone for Entry<T, M>

source§

fn clone(&self) -> Entry<T, M>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<T: Debug, M: Debug> Debug for Entry<T, M>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<T, M> Deref for Entry<T, M>

§

type Target = Meta<T, M>

The resulting type after dereferencing.
source§

fn deref(&self) -> &Self::Target

Dereferences the value.
source§

impl<T, M> DerefMut for Entry<T, M>

source§

fn deref_mut(&mut self) -> &mut Self::Target

Mutably dereferences the value.
source§

impl<T: Hash, M: Hash> Hash for Entry<T, M>

source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)where H: Hasher, Self: Sized,

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

impl<T: Ord, M: Ord> Ord for Entry<T, M>

source§

fn cmp(&self, other: &Entry<T, M>) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · source§

fn max(self, other: Self) -> Selfwhere Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · source§

fn min(self, other: Self) -> Selfwhere Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · source§

fn clamp(self, min: Self, max: Self) -> Selfwhere Self: Sized + PartialOrd<Self>,

Restrict a value to a certain interval. Read more
source§

impl<T: PartialEq, M: PartialEq> PartialEq<Entry<T, M>> for Entry<T, M>

source§

fn eq(&self, other: &Entry<T, M>) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<T: PartialOrd, M: PartialOrd> PartialOrd<Entry<T, M>> for Entry<T, M>

source§

fn partial_cmp(&self, other: &Entry<T, M>) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

fn lt(&self, other: &Rhs) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

fn le(&self, other: &Rhs) -> bool

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · source§

fn gt(&self, other: &Rhs) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

fn ge(&self, other: &Rhs) -> bool

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more
source§

impl<T: StrippedHash, M> StrippedHash for Entry<T, M>

source§

fn stripped_hash<H: Hasher>(&self, state: &mut H)

source§

impl<T: StrippedPartialEq<__T>, M, __T, __M> StrippedPartialEq<Entry<__T, __M>> for Entry<T, M>

source§

fn stripped_eq(&self, other: &Entry<__T, __M>) -> bool

source§

impl<T: Copy, M: Copy> Copy for Entry<T, M>

source§

impl<T: Eq, M: Eq> Eq for Entry<T, M>

source§

impl<T: StrippedEq, M> StrippedEq for Entry<T, M>

source§

impl<T, M> StructuralEq for Entry<T, M>

source§

impl<T, M> StructuralPartialEq for Entry<T, M>

Auto Trait Implementations§

§

impl<T, M> RefUnwindSafe for Entry<T, M>where M: RefUnwindSafe, T: RefUnwindSafe,

§

impl<T, M> Send for Entry<T, M>where M: Send, T: Send,

§

impl<T, M> Sync for Entry<T, M>where M: Sync, T: Sync,

§

impl<T, M> Unpin for Entry<T, M>where M: Unpin, T: Unpin,

§

impl<T, M> UnwindSafe for Entry<T, M>where M: UnwindSafe, T: UnwindSafe,

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> At for T

source§

fn at<M>(self, metadata: M) -> Meta<T, M>

Wraps self inside a Meta<Self, M> using the given metadata. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

const: unstable · source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

const: unstable · source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> BorrowStripped for T

source§

fn stripped(&self) -> &Stripped<T>

source§

impl<T> BorrowUnordered for T

source§

fn unordered(&self) -> &Unordered<T>

§

impl<T> CallHasher for Twhere T: Hash + ?Sized,

§

default fn get_hash<H, B>(value: &H, build_hasher: &B) -> u64where H: Hash + ?Sized, B: BuildHasher,

source§

impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

source§

fn equivalent(&self, key: &K) -> bool

source§

impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<T> From<T> for T

const: unstable · source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

const: unstable · source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

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

fn clone_into(&self, target: &mut T)

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

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
const: unstable · source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
const: unstable · source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<T> WithContext for Twhere T: ?Sized,

source§

fn with<C>(&self, context: C) -> Contextual<&T, C>

source§

fn into_with<C>(self, context: C) -> Contextual<T, C>