Struct json_ld_core::object::list::List

source ·
pub struct List<T, B, M> { /* private fields */ }
Expand description

List object.

Implementations§

source§

impl<T, B, M> List<T, B, M>

source

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

source

pub fn len(&self) -> usize

source

pub fn is_empty(&self) -> bool

source

pub fn entry(&self) -> &Entry<Vec<IndexedObject<T, B, M>>, M>

Returns a reference to the “@list” entry of the list object.

source

pub fn entry_mut(&mut self) -> &mut Entry<Vec<IndexedObject<T, B, M>>, M>

source

pub fn into_entry(self) -> Entry<Vec<IndexedObject<T, B, M>>, M>

source

pub fn push(&mut self, object: IndexedObject<T, B, M>)

source

pub fn pop(&mut self) -> Option<IndexedObject<T, B, M>>

source

pub fn iter(&self) -> Iter<'_, IndexedObject<T, B, M>>

source

pub fn iter_mut(&mut self) -> IterMut<'_, IndexedObject<T, B, M>>

source

pub fn as_slice(&self) -> &[IndexedObject<T, B, M>]

source

pub fn as_mut_slice(&mut self) -> &mut [IndexedObject<T, B, M>]

source

pub fn canonicalize_with(&mut self, buffer: &mut Buffer)

Puts this list object literals into canonical form using the given buffer.

The buffer is used to compute the canonical form of numbers.

source

pub fn canonicalize(&mut self)

Puts this list object literals into canonical form.

Trait Implementations§

source§

impl<T, B, M> Any<T, B, M> for List<T, B, M>

source§

fn as_ref(&self) -> Ref<'_, T, B, M>

source§

fn id_entry<'a>(&'a self) -> Option<&'a Entry<Id<T, B>, M>>where M: 'a,

source§

fn id<'a>(&'a self) -> Option<&'a Meta<Id<T, B>, M>>where M: 'a,

source§

fn language<'a>(&'a self) -> Option<LenientLanguageTag<'_>>where T: 'a, B: 'a, M: 'a,

source§

fn is_value(&self) -> bool

source§

fn is_node(&self) -> bool

source§

fn is_graph(&self) -> bool

source§

fn is_list(&self) -> bool

source§

impl<T: Clone, B: Clone, M: Clone> Clone for List<T, B, M>

source§

fn clone(&self) -> List<T, B, 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: Hash, B: Hash, M: Hash> Hash for List<T, B, 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<'a, T, B, M> IntoIterator for &'a List<T, B, M>

§

type Item = &'a Meta<Indexed<Object<T, B, M>, M>, M>

The type of the elements being iterated over.
§

type IntoIter = Iter<'a, Meta<Indexed<Object<T, B, M>, M>, M>>

Which kind of iterator are we turning this into?
source§

fn into_iter(self) -> Self::IntoIter

Creates an iterator from a value. Read more
source§

impl<'a, T, B, M> IntoIterator for &'a mut List<T, B, M>

§

type Item = &'a mut Meta<Indexed<Object<T, B, M>, M>, M>

The type of the elements being iterated over.
§

type IntoIter = IterMut<'a, Meta<Indexed<Object<T, B, M>, M>, M>>

Which kind of iterator are we turning this into?
source§

fn into_iter(self) -> Self::IntoIter

Creates an iterator from a value. Read more
source§

impl<T, B, M> IntoIterator for List<T, B, M>

§

type Item = Meta<Indexed<Object<T, B, M>, M>, M>

The type of the elements being iterated over.
§

type IntoIter = IntoIter<Meta<Indexed<Object<T, B, M>, M>, M>, Global>

Which kind of iterator are we turning this into?
source§

fn into_iter(self) -> Self::IntoIter

Creates an iterator from a value. Read more
source§

impl<T, B, M: Clone, N: Vocabulary<Iri = T, BlankId = B>> IntoJsonWithContextMeta<M, N> for List<T, B, M>

source§

fn into_json_meta_with(self, meta: M, vocabulary: &N) -> Meta<Value<M>, M>

source§

impl<T: Eq + Hash, B: Eq + Hash, M> MappedEq<List<T, B, M>> for List<T, B, M>

§

type BlankId = B

source§

fn mapped_eq<'a, 'b, F: Clone + Fn(&'a B) -> &'b B>( &'a self, other: &Self, f: F ) -> boolwhere B: 'a + 'b,

Structural equality with mapped blank identifiers. Read more
source§

impl<T, B, M> PartialEq<List<T, B, M>> for List<T, B, M>where T: Eq + Hash, B: Eq + Hash, M: PartialEq,

source§

fn eq(&self, other: &Self) -> 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, B, M> Relabel<T, B, M> for List<T, B, M>

source§

fn relabel_with<N: Vocabulary<Iri = T, BlankId = B>, G: MetaGenerator<N, M>>( &mut self, vocabulary: &mut N, generator: &mut G, relabeling: &mut HashMap<B, Meta<Subject<T, B>, M>> )where M: Clone, T: Clone + Eq + Hash, B: Clone + Eq + Hash,

source§

impl<T: Hash, B: Hash, M> StrippedHash for List<T, B, M>

source§

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

source§

impl<T: Eq + Hash, B: Eq + Hash, M> StrippedPartialEq<List<T, B, M>> for List<T, B, M>

source§

fn stripped_eq(&self, other: &Self) -> bool

source§

impl<T, B, M> Eq for List<T, B, M>where T: Eq + Hash, B: Eq + Hash, M: Eq,

source§

impl<T: Eq + Hash, B: Eq + Hash, M> StrippedEq for List<T, B, M>

Auto Trait Implementations§

§

impl<T, B, M> RefUnwindSafe for List<T, B, M>where B: RefUnwindSafe, M: RefUnwindSafe, T: RefUnwindSafe,

§

impl<T, B, M> Send for List<T, B, M>where B: Send, M: Send, T: Send,

§

impl<T, B, M> Sync for List<T, B, M>where B: Sync, M: Sync, T: Sync,

§

impl<T, B, M> Unpin for List<T, B, M>where M: Unpin, T: Unpin,

§

impl<T, B, M> UnwindSafe for List<T, B, M>where B: UnwindSafe, 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,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

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

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

Checks if this value is equivalent to the given key. Read more
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

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, C> FromWithContext<T, C> for T

source§

fn from_with(value: T, _context: &C) -> T

source§

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

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, U, C> IntoWithContext<U, C> for Twhere U: FromWithContext<T, C>,

source§

fn into_with(self, context: &C) -> U

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> ToOwned for T

§

type Owned = T

source§

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

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

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

Performs the conversion.
source§

impl<T, U, C> TryFromWithContext<U, C> for Twhere U: IntoWithContext<T, C>,

§

type Error = Infallible

source§

fn try_from_with( value: U, context: &C ) -> Result<T, <T as TryFromWithContext<U, C>>::Error>

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.
source§

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

Performs the conversion.
source§

impl<T, U, C> TryIntoWithContext<U, C> for Twhere U: TryFromWithContext<T, C>,

§

type Error = <U as TryFromWithContext<T, C>>::Error

source§

fn try_into_with( self, context: &C ) -> Result<U, <T as TryIntoWithContext<U, C>>::Error>

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>