Struct List

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

List object.

Implementations§

Source§

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

Source

pub fn new(objects: Vec<Indexed<Object<T, B>>>) -> List<T, B>

Creates a new list object.

Source

pub fn len(&self) -> usize

Source

pub fn is_empty(&self) -> bool

Source

pub fn entry(&self) -> &[Indexed<Object<T, B>>]

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

Alias for as_slice.

Source

pub fn entry_mut(&mut self) -> &mut Vec<Indexed<Object<T, B>>>

Source

pub fn as_slice(&self) -> &[Indexed<Object<T, B>>]

Source

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

Source

pub fn into_entry(self) -> Vec<Indexed<Object<T, B>>>

Source

pub fn push(&mut self, object: Indexed<Object<T, B>>)

Source

pub fn pop(&mut self) -> Option<Indexed<Object<T, B>>>

Source

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

Source

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

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.

Source

pub fn map_ids<U, C>( self, map_iri: impl FnMut(T) -> U, map_id: impl FnMut(Id<T, B>) -> Id<U, C>, ) -> List<U, C>
where U: Eq + Hash, C: Eq + Hash,

Map the identifiers present in this list (recursively).

Trait Implementations§

Source§

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

Source§

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

Source§

fn id(&self) -> Option<&Id<T, B>>

Source§

fn language<'a>(&'a self) -> Option<&'a LenientLangTag>
where T: 'a, B: '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, B> Clone for List<T, B>
where T: Clone, B: Clone,

Source§

fn clone(&self) -> List<T, B>

Returns a duplicate 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, B> Debug for List<T, B>
where T: Debug, B: Debug,

Source§

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

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

impl<T, B> Hash for List<T, B>
where T: Hash, B: Hash,

Source§

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

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> IntoIterator for &'a List<T, B>

Source§

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

The type of the elements being iterated over.
Source§

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

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

fn into_iter(self) -> <&'a List<T, B> as IntoIterator>::IntoIter

Creates an iterator from a value. Read more
Source§

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

Source§

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

The type of the elements being iterated over.
Source§

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

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

fn into_iter(self) -> <&'a mut List<T, B> as IntoIterator>::IntoIter

Creates an iterator from a value. Read more
Source§

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

Source§

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

The type of the elements being iterated over.
Source§

type IntoIter = IntoIter<Indexed<Object<T, B>>>

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

fn into_iter(self) -> <List<T, B> as IntoIterator>::IntoIter

Creates an iterator from a value. Read more
Source§

impl<T, B, N> IntoJsonWithContext<N> for List<T, B>
where N: Vocabulary<Iri = T, BlankId = B>,

Source§

fn into_json_with(self, vocabulary: &N) -> Value

Source§

impl<T, B, V, I> LinkedData<I, V> for List<T, B>

Source§

fn visit<S>( &self, visitor: S, ) -> Result<<S as Visitor<I, V>>::Ok, <S as Visitor<I, V>>::Error>
where S: Visitor<I, V>,

Visit the RDF dataset represented by this type.
Source§

impl<T, B, V, I> LinkedDataGraph<I, V> for List<T, B>

Source§

fn visit_graph<S>( &self, visitor: S, ) -> Result<<S as GraphVisitor<I, V>>::Ok, <S as GraphVisitor<I, V>>::Error>
where S: GraphVisitor<I, V>,

Source§

impl<T, B, V, I> LinkedDataPredicateObjects<I, V> for List<T, B>

Source§

fn visit_objects<S>( &self, visitor: S, ) -> Result<<S as PredicateObjectsVisitor<I, V>>::Ok, <S as PredicateObjectsVisitor<I, V>>::Error>
where S: PredicateObjectsVisitor<I, V>,

Source§

impl<T, B, V, I> LinkedDataResource<I, V> for List<T, B>

Source§

fn interpretation( &self, _vocabulary: &mut V, _interpretation: &mut I, ) -> ResourceInterpretation<'_, I, V>

Source§

fn lexical_representation<'a>( &'a self, vocabulary: &'a mut V, interpretation: &'a mut I, ) -> Option<CowRdfTerm<'a, V>>
where I: ReverseTermInterpretation<Iri = <V as IriVocabulary>::Iri, BlankId = <V as BlankIdVocabulary>::BlankId, Literal = <V as LiteralVocabulary>::Literal>,

Source§

fn reference_interpretation( &self, vocabulary: &mut V, interpretation: &mut I, ) -> ResourceInterpretation<'_, I, V>

Source§

impl<T, B, V, I> LinkedDataSubject<I, V> for List<T, B>

Source§

fn visit_subject<S>( &self, visitor: S, ) -> Result<<S as SubjectVisitor<I, V>>::Ok, <S as SubjectVisitor<I, V>>::Error>
where S: SubjectVisitor<I, V>,

Source§

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

Source§

type BlankId = B

Source§

fn mapped_eq<'a, 'b, F>(&'a self, other: &List<T, B>, f: F) -> bool
where F: Clone + Fn(&'a B) -> &'b B, B: 'a + 'b,

Structural equality with mapped blank identifiers. Read more
Source§

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

Source§

fn eq(&self, other: &List<T, B>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<T, B> Relabel<T, B> for List<T, B>

Source§

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

Source§

fn relabel<G>( &mut self, generator: &mut G, relabeling: &mut HashMap<B, Id<T, B>>, )
where G: Generator, T: Clone + Eq + Hash, B: Clone + Eq + Hash, (): Vocabulary<Iri = T, BlankId = B>,

Source§

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

Auto Trait Implementations§

§

impl<T, B> Freeze for List<T, B>

§

impl<T, B> RefUnwindSafe for List<T, B>

§

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

§

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

§

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

§

impl<T, B> UnwindSafe for List<T, B>
where T: UnwindSafe, B: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where 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 T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where 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§

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

Source§

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

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<I, B, T> CompactIndexedFragment<I, B> for T
where T: Any<I, B>,

Source§

async fn compact_indexed_fragment<'a, N, L>( &'a self, vocabulary: &'a mut N, index: Option<&'a str>, active_context: &'a Context<I, B>, type_scoped_context: &'a Context<I, B>, active_property: Option<&'a str>, loader: &'a L, options: Options, ) -> Result<Value, Error>
where N: VocabularyMut<Iri = I, BlankId = B>, I: Clone + Hash + Eq, B: Clone + Hash + Eq, L: Loader,

Source§

impl<Q, K> Equivalent<K> for Q
where 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 Q
where 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<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

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

Source§

impl<Q, K> Equivalent<K> for Q
where 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<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> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where 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 T
where U: FromWithContext<T, C>,

Source§

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

Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

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

Source§

type Owned = T

Source§

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

Source§

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 T
where U: IntoWithContext<T, C>,

Source§

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 T
where U: TryFrom<T>,

Source§

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 T
where U: TryFromWithContext<T, C>,

Source§

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 T
where T: ?Sized,

Source§

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

Source§

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

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> ErasedDestructor for T
where T: 'static,