[][src]Struct dashcache::arr::CachedArr

#[repr(transparent)]pub struct CachedArr<A, P = (), H = ()> { /* fields omitted */ }

A cached array satisfying a given predicate P

Implementations

impl<A, P, H> CachedArr<A, P, H>[src]

pub fn as_ptr(&self) -> *const A[src]

Get the pointer to the first element of this CachedArr, or null if there is none (i.e. the slice is empty)

pub fn as_slice(&self) -> &[A][src]

Get the slice underlying this CachedArr

pub fn iter(&self) -> Iter<'_, A>[src]

Iterate over the items of this CachedArr

pub fn as_arr(&self) -> &CachedArr<A, (), H>[src]

Strip the predicate from this CachedArr

pub fn into_arr(self) -> CachedArr<A, (), H>[src]

Strip the predicate from this CachedArr, consuming it.

pub fn coerce<Q>(self) -> CachedArr<A, Q, H>[src]

Coerce this array into one satisfying another predicate

pub fn coerce_ref<Q>(&self) -> &CachedArr<A, Q, H>[src]

Coerce this array as a reference into one satisfying another predicate

impl<A> CachedArr<A>[src]

pub fn from_exact<I: ExactSizeIterator + Iterator<Item = A>>(
    iter: I
) -> CachedArr<A>
[src]

Create a new cached array from an exact length iterator

impl<A, P: EmptyPredicate> CachedArr<A, P>[src]

pub const EMPTY: CachedArr<A, P>[src]

Get a constant empty CachedArr

impl<A: Deref, P, H> CachedArr<A, P, H>[src]

pub fn is_sorted(&self) -> bool[src]

Check if this array is sorted by address

pub fn is_set(&self) -> bool[src]

Check if this array is strictly sorted by address

pub fn try_as_bag(&self) -> Result<&CachedBag<A, H>, &Self>[src]

Try to cast this array into a bag if sorted

pub fn try_as_set(&self) -> Result<&CachedSet<A, H>, &Self>[src]

Try to cast this array into a set if strictly sorted

pub fn sorted(&self) -> CachedBag<A> where
    A: Clone
[src]

Sort this array and return it

pub fn set(&self) -> CachedSet<A> where
    A: Clone
[src]

Sort and deduplicate this array and return it

pub fn try_into_bag(self) -> Result<CachedBag<A, H>, Self>[src]

Try to cast this array into a bag if sorted

pub fn try_into_set(self) -> Result<CachedSet<A, H>, Self>[src]

Try to cast this array into a set if strictly sorted

impl<A: Deref, P: BagMarker, H> CachedArr<A, P, H>[src]

pub fn as_bag(&self) -> &CachedBag<A, H>[src]

Cast this array into a bag

pub fn into_bag(self) -> CachedBag<A, H>[src]

Cast this array into a bag

impl<A: Deref, P: SetMarker, H> CachedArr<A, P, H>[src]

pub fn as_set(&self) -> &CachedSet<A, H>[src]

Cast this array into a set

pub fn into_set(self) -> CachedSet<A, H>[src]

Cast this array into a set

impl<A: Deref + Clone, H> CachedArr<A, Sorted, H>[src]

pub fn contains_impl(&self, item: *const A::Target) -> Option<&A>[src]

Check whether an item is in this bag. If it is, return a reference.

pub fn uniq_impl(&self) -> CachedSet<A>[src]

Deduplicate this bag into a set

impl<A: Deref + Clone> CachedArr<A, Sorted, H>[src]

pub fn merge_impl(&self, rhs: &CachedBag<A>) -> CachedBag<A>[src]

Merge two bags

pub fn intersect_impl(&self, rhs: &CachedBag<A>) -> CachedBag<A>[src]

Take the intersection of two bags

impl<A: Deref + Clone, P: BagMarker, H> CachedArr<A, P, H>[src]

pub fn contains(&self, item: *const A::Target) -> Option<&A>[src]

Check whether an item is in this bag. If it is, return a reference.

impl<A: Deref + Clone, P: BagMarker> CachedArr<A, P>[src]

pub fn merge<Q: BagMarker>(&self, rhs: &CachedArr<A, Q>) -> CachedBag<A>[src]

Merge two bags

pub fn intersect<Q: BagMarker>(&self, rhs: &CachedArr<A, Q>) -> CachedArr<A, P>[src]

Take the intersection of two bags

pub fn uniq(&self) -> CachedSet<A>[src]

Deduplicate this bag into a set

impl<A: Deref + Clone> CachedArr<A, Uniq, H>[src]

pub fn union_impl(&self, rhs: &CachedSet<A>) -> CachedSet<A>[src]

Take the union of two sets

impl<A: Deref + Clone, P: SetMarker> CachedArr<A, P>[src]

pub fn union<Q: SetMarker>(&self, rhs: &CachedArr<A, Q>) -> CachedSet<A>[src]

Take the union of two sets

Trait Implementations

impl<A: Eq + Deref, P> Caches<[A]> for CachedArr<A, P>[src]

impl<A: Eq + Deref, P> CanCollect for CachedArr<A, P>[src]

impl<A, P, H> Clone for CachedArr<A, P, H>[src]

impl<A, P> Debug for CachedArr<A, P> where
    A: Debug
[src]

impl<A, P: EmptyPredicate> Default for CachedArr<A, P>[src]

impl<A, P> Deref for CachedArr<A, P>[src]

type Target = [A]

The resulting type after dereferencing.

impl<A: Deref, P, H> Eq for CachedArr<A, P, H>[src]

impl<A: Clone, '_> From<&'_ [A]> for CachedArr<A>[src]

impl<A> From<Vec<A>> for CachedArr<A>[src]

impl<A> FromIterator<A> for CachedArr<A>[src]

impl<A, P> Hash for CachedArr<A, P> where
    A: Deref
[src]

impl<A: Deref, P, Q, H> PartialEq<CachedArr<A, P, H>> for CachedArr<A, Q, H>[src]

Auto Trait Implementations

impl<A, P, H> RefUnwindSafe for CachedArr<A, P, H> where
    A: RefUnwindSafe,
    H: RefUnwindSafe,
    P: RefUnwindSafe

impl<A, P, H> Send for CachedArr<A, P, H> where
    A: Send + Sync,
    H: Send + Sync,
    P: Send

impl<A, P, H> Sync for CachedArr<A, P, H> where
    A: Send + Sync,
    H: Send + Sync,
    P: Sync

impl<A, P, H> Unpin for CachedArr<A, P, H> where
    A: Unpin,
    H: Unpin,
    P: Unpin

impl<A, P, H> UnwindSafe for CachedArr<A, P, H> where
    A: RefUnwindSafe + UnwindSafe,
    H: RefUnwindSafe + UnwindSafe,
    P: UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> CallHasher for T where
    T: Hash
[src]

impl<T> Erasable for T[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.