pub struct SmartList<T> {
pub data: Vec<T>,
pub total_count: Option<u64>,
pub aggregations: Record,
pub summary: Record,
}Fields§
§data: Vec<T>§total_count: Option<u64>§aggregations: Record§summary: RecordImplementations§
Source§impl<T> SmartList<T>
impl<T> SmartList<T>
pub fn empty() -> Self
pub fn new(data: Vec<T>) -> Self
pub fn with_total_count(self, total_count: u64) -> Self
pub fn with_aggregation( self, key: impl Into<String>, value: impl Into<Value>, ) -> Self
pub fn with_summary( self, key: impl Into<String>, value: impl Into<Value>, ) -> Self
pub fn push(&mut self, value: T)
pub fn extend(&mut self, values: impl IntoIterator<Item = T>)
pub fn set(&mut self, index: usize, value: T) -> Option<T>
pub fn get(&self, index: usize) -> Option<&T>
pub fn get_mut(&mut self, index: usize) -> Option<&mut T>
pub fn last(&self) -> Option<&T>
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
pub fn first(&self) -> Option<&T>
pub fn iter(&self) -> Iter<'_, T>
pub fn iter_mut(&mut self) -> IterMut<'_, T>
pub fn as_slice(&self) -> &[T]
pub fn as_mut_slice(&mut self) -> &mut [T]
pub fn retain(&mut self, filter: impl FnMut(&T) -> bool)
pub fn total_count_or_len(&self) -> u64
pub fn aggregation(&self, key: &str) -> Option<&Value>
pub fn summary(&self, key: &str) -> Option<&Value>
pub fn aggregation_json(&self) -> Value
pub fn summary_json(&self) -> Value
pub fn into_vec(self) -> Vec<T>
pub fn map<U>(self, mapper: impl FnMut(T) -> U) -> SmartList<U>
pub fn to_list<U>(&self, mapper: impl FnMut(&T) -> U) -> Vec<U>
pub fn to_set<U>(&self, mapper: impl FnMut(&T) -> U) -> BTreeSet<U>where
U: Ord,
pub fn identity_map<K>(&self, key: impl FnMut(&T) -> K) -> BTreeMap<K, T>
pub fn group_by<K>(&self, key: impl FnMut(&T) -> K) -> BTreeMap<K, Vec<T>>
pub fn merge_by<K>( &mut self, incoming: impl IntoIterator<Item = T>, key: impl FnMut(&T) -> K, )
pub fn into_records(self) -> SmartList<Record>where
T: Entity,
Source§impl<T> SmartList<T>where
T: IdentifiableEntity,
impl<T> SmartList<T>where
T: IdentifiableEntity,
Trait Implementations§
Source§impl<T> Extend<T> for SmartList<T>
impl<T> Extend<T> for SmartList<T>
Source§fn extend<I: IntoIterator<Item = T>>(&mut self, iter: I)
fn extend<I: IntoIterator<Item = T>>(&mut self, iter: I)
Extends a collection with the contents of an iterator. Read more
Source§fn extend_one(&mut self, item: A)
fn extend_one(&mut self, item: A)
🔬This is a nightly-only experimental API. (
extend_one)Extends a collection with exactly one element.
Source§fn extend_reserve(&mut self, additional: usize)
fn extend_reserve(&mut self, additional: usize)
🔬This is a nightly-only experimental API. (
extend_one)Reserves capacity in a collection for the given number of additional elements. Read more
Source§impl<T> FromIterator<T> for SmartList<T>
impl<T> FromIterator<T> for SmartList<T>
Source§fn from_iter<I: IntoIterator<Item = T>>(iter: I) -> Self
fn from_iter<I: IntoIterator<Item = T>>(iter: I) -> Self
Creates a value from an iterator. Read more
Source§impl<'a, T> IntoIterator for &'a SmartList<T>
impl<'a, T> IntoIterator for &'a SmartList<T>
Source§impl<'a, T> IntoIterator for &'a mut SmartList<T>
impl<'a, T> IntoIterator for &'a mut SmartList<T>
Source§impl<T> IntoIterator for SmartList<T>
impl<T> IntoIterator for SmartList<T>
Source§impl<T> TeaqlEmpty for SmartList<T>
impl<T> TeaqlEmpty for SmartList<T>
fn teaql_is_empty(&self) -> bool
impl<T> StructuralPartialEq for SmartList<T>
Auto Trait Implementations§
impl<T> Freeze for SmartList<T>
impl<T> RefUnwindSafe for SmartList<T>where
T: RefUnwindSafe,
impl<T> Send for SmartList<T>where
T: Send,
impl<T> Sync for SmartList<T>where
T: Sync,
impl<T> Unpin for SmartList<T>where
T: Unpin,
impl<T> UnsafeUnpin for SmartList<T>
impl<T> UnwindSafe for SmartList<T>where
T: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more