Skip to main content

SharedMapQuery

Struct SharedMapQuery 

Source
pub struct SharedMapQuery<K, V>
where K: CellValue + Hash + Eq, V: CellValue,
{ /* private fields */ }
Expand description

Clone-able multicast handle for fanning a MapQuery out to many consumers without an intermediate crate::CellMap.

Cloning is an Arc bump and does not subscribe upstream. Subscription happens lazily on the first downstream materialize() (or other install). Once installed, the upstream subscription stays live until the last shared subscriber drops.

Implementations§

Source§

impl<K, V> SharedMapQuery<K, V>
where K: CellValue + Hash + Eq, V: CellValue,

Source

pub fn new<Q: MapQuery<K, V>>(q: Q) -> Self

Wrap a map query in a shared, multicast handle.

Prefer the MapQueryShareExt::share extension method — it reads as query.share() at the call site.

Trait Implementations§

Source§

impl<K, V> Clone for SharedMapQuery<K, V>
where K: CellValue + Hash + Eq, V: CellValue,

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

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

Performs copy-assignment from source. Read more
Source§

impl<K, V> MapQuery<K, V> for SharedMapQuery<K, V>
where K: CellValue + Hash + Eq, V: CellValue,

Source§

fn materialize(self) -> CellMap<K, V, CellImmutable>

Compile the query into a CellMap and install root-source subscriptions running the fused diff-propagation closure. Read more

Auto Trait Implementations§

§

impl<K, V> !RefUnwindSafe for SharedMapQuery<K, V>

§

impl<K, V> !UnwindSafe for SharedMapQuery<K, V>

§

impl<K, V> Freeze for SharedMapQuery<K, V>

§

impl<K, V> Send for SharedMapQuery<K, V>

§

impl<K, V> Sync for SharedMapQuery<K, V>

§

impl<K, V> Unpin for SharedMapQuery<K, V>

§

impl<K, V> UnsafeUnpin for SharedMapQuery<K, V>

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> 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> 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<K, V, M> CountByExt<K, V> for M
where K: Hash + Eq + CellValue, V: CellValue, M: MapQuery<K, V>,

Source§

fn count_by<GK, F>(self, group_key: F) -> CountByPlan<Self, K, V, GK, F>
where GK: Hash + Eq + CellValue, F: Fn(&K, &V) -> GK + Send + Sync + 'static,

Groups rows by group_key(&source_key, &source_value) and stores how many rows are in each group. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<K, V, M> GroupByExt<K, V> for M
where K: Hash + Eq + CellValue, V: CellValue, M: MapQuery<K, V>,

Source§

fn group_by<GK, F>(self, group_key: F) -> GroupByPlan<Self, K, V, GK, F>
where K: Ord, GK: Hash + Eq + CellValue, F: Fn(&K, &V) -> GK + Send + Sync + 'static,

Groups source rows by group_key(&source_key, &source_value). Read more
Source§

impl<K, V, M> InnerJoinExt<K, V> for M
where K: Hash + Eq + CellValue, V: CellValue, M: MapQuery<K, V>,

Source§

fn inner_join<R, RV>(self, right: R) -> InnerJoinByKeyPlan<Self, R, K, V, RV>
where R: MapQuery<K, RV>, RV: CellValue,

Inner join on equal map keys. Read more
Source§

fn inner_join_fk<R, RK, RV>( self, right: R, ) -> InnerJoinByPairPlan<Self, R, K, V, RK, RV, K, impl Fn(&K, &V) -> K + Send + Sync + 'static, impl Fn(&RK, &RV) -> K + Send + Sync + 'static>
where R: MapQuery<RK, RV>, RK: Hash + Eq + CellValue, RV: CellValue + HasForeignKey<V>, <<RV as HasForeignKey<V>>::ForeignKey as IdFor<V>>::MapKey: Into<K>,

Inner join using foreign key relationship. Read more
Source§

fn inner_join_by<R, RK, RV, JK, FL, FR>( self, right: R, left_key: FL, right_key: FR, ) -> InnerJoinByPairPlan<Self, R, K, V, RK, RV, JK, FL, FR>
where R: MapQuery<RK, RV>, RK: Hash + Eq + CellValue, RV: CellValue, JK: Hash + Eq + CellValue, FL: Fn(&K, &V) -> JK + Send + Sync + 'static, FR: Fn(&RK, &RV) -> JK + Send + Sync + 'static,

Inner join using explicit key extractors. 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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

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

Source§

fn join_key_from(value: &T) -> T

Source§

impl<K, V, M> LeftJoinExt<K, V> for M
where K: Hash + Eq + CellValue, V: CellValue, M: MapQuery<K, V>,

Source§

fn left_join<R, RV>( self, right: R, ) -> LeftJoinPlan<Self, R, K, V, K, RV, K, impl Fn(&K, &V) -> K + Send + Sync + 'static, impl Fn(&K, &RV) -> K + Send + Sync + 'static>
where R: MapQuery<K, RV>, RV: CellValue,

Left join on equal map keys. Read more
Source§

fn left_join_fk<R, RK, RV>( self, right: R, ) -> LeftJoinPlan<Self, R, K, V, RK, RV, K, impl Fn(&K, &V) -> K + Send + Sync + 'static, impl Fn(&RK, &RV) -> K + Send + Sync + 'static>
where R: MapQuery<RK, RV>, RK: Hash + Eq + CellValue, RV: CellValue + HasForeignKey<V>, <<RV as HasForeignKey<V>>::ForeignKey as IdFor<V>>::MapKey: Into<K>,

Left join using foreign key relationship. Read more
Source§

fn left_join_by<R, RK, RV, JK, FL, FR>( self, right: R, left_key: FL, right_key: FR, ) -> LeftJoinPlan<Self, R, K, V, RK, RV, JK, FL, FR>
where R: MapQuery<RK, RV>, RK: Hash + Eq + CellValue, RV: CellValue, JK: Hash + Eq + CellValue, FL: Fn(&K, &V) -> JK + Send + Sync + 'static, FR: Fn(&RK, &RV) -> JK + Send + Sync + 'static,

Left join using explicit key extractors. Read more
Source§

impl<K, V, M> LeftSemiJoinExt<K, V> for M
where K: Hash + Eq + CellValue, V: CellValue, M: MapQuery<K, V>,

Source§

fn left_semi_join<R, RV>( self, right: R, ) -> LeftSemiJoinPlan<Self, R, K, V, K, RV, K, impl Fn(&K, &V) -> K + Send + Sync + 'static, impl Fn(&K, &RV) -> K + Send + Sync + 'static>
where R: MapQuery<K, RV>, RV: CellValue,

Left semi join on equal map keys. Read more
Source§

fn left_semi_join_fk<R, RK, RV>( self, right: R, ) -> LeftSemiJoinPlan<Self, R, K, V, RK, RV, K, impl Fn(&K, &V) -> K + Send + Sync + 'static, impl Fn(&RK, &RV) -> K + Send + Sync + 'static>
where R: MapQuery<RK, RV>, RK: Hash + Eq + CellValue, RV: CellValue + HasForeignKey<V>, <<RV as HasForeignKey<V>>::ForeignKey as IdFor<V>>::MapKey: Into<K>,

Left semi join using foreign key relationship. Read more
Source§

fn left_semi_join_by<R, RK, RV, JK, FL, FR>( self, right: R, left_key: FL, right_key: FR, ) -> LeftSemiJoinPlan<Self, R, K, V, RK, RV, JK, FL, FR>
where R: MapQuery<RK, RV>, RK: Hash + Eq + CellValue, RV: CellValue, JK: Hash + Eq + CellValue, FL: Fn(&K, &V) -> JK + Send + Sync + 'static, FR: Fn(&RK, &RV) -> JK + Send + Sync + 'static,

Left semi join using explicit key extractors. Read more
Source§

impl<K, V, Q> MapQueryShareExt<K, V> for Q
where K: CellValue + Hash + Eq, V: CellValue, Q: MapQuery<K, V>,

Source§

fn share(self) -> SharedMapQuery<K, V>

Convert this map query into a Clone-able multicast handle.
Source§

impl<K, V, M> MultiLeftJoinExt<K, V> for M
where K: Hash + Eq + CellValue, V: CellValue, M: MapQuery<K, V>,

Source§

fn multi_left_join_by<R, RK, RV, JK, FL, FR>( self, right: R, left_keys: FL, right_key: FR, ) -> MultiLeftJoinPlan<Self, R, K, V, RK, RV, JK, FL, FR>
where R: MapQuery<RK, RV>, RK: Hash + Eq + CellValue, RV: CellValue, JK: Hash + Eq + CellValue, FL: Fn(&K, &V) -> Vec<JK> + Send + Sync + 'static, FR: Fn(&RK, &RV) -> JK + Send + Sync + 'static,

Left join where each left item maps to multiple join keys. Read more
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<K, V, M> ProjectCellExt<K, V> for M
where K: Hash + Eq + CellValue, V: CellValue, M: MapQuery<K, V>,

Source§

fn project_cell<K2, V2, W, F>( self, mapper: F, ) -> ProjectCellPlan<Self, K, V, K2, V2, W, F>
where K2: Hash + Eq + CellValue, V2: CellValue, W: Watchable<Option<(K2, V2)>> + Gettable<Option<(K2, V2)>> + Clone + Send + Sync + 'static, F: Fn(&K, &V) -> W + Send + Sync + 'static,

Reactive project variant: each row maps to a watchable optional output row. Read more
Source§

impl<K, V, M> ProjectManyExt<K, V> for M
where K: Hash + Eq + CellValue, V: CellValue, M: MapQuery<K, V>,

Source§

fn project_many<K2, V2, F>(self, f: F) -> ProjectManyPlan<Self, K, V, K2, V2, F>
where K2: Hash + Eq + CellValue, V2: CellValue, F: Fn(&K, &V) -> Vec<(K2, V2)> + Send + Sync + 'static,

Projects each source row to zero, one, or many output rows. Read more
Source§

impl<K, V, M> ProjectMapExt<K, V> for M
where K: Hash + Eq + CellValue, V: CellValue, M: MapQuery<K, V>,

Source§

fn project<K2, V2, F>(self, f: F) -> ProjectPlan<Self, K, V, K2, V2, F>
where K2: Hash + Eq + CellValue, V2: CellValue, F: Fn(&K, &V) -> Option<(K2, V2)> + Send + Sync + 'static,

Projects each source row to at most one output row. Read more
Source§

impl<K, V, M> SelectCellExt<K, V> for M
where K: Hash + Eq + CellValue, V: CellValue, M: MapQuery<K, V>,

Source§

fn select_cell<W, F>(self, predicate: F) -> SelectCellPlan<Self, K, V, W, F>
where W: Pipeline<bool> + PipelineSeed<bool> + Gettable<bool> + Clone + Send + Sync + 'static, F: Fn(&K, &V) -> W + Send + Sync + 'static,

Reactive filter: each row has a watchable boolean gate. Read more
Source§

impl<K, V, M> SelectExt<K, V> for M
where K: Hash + Eq + CellValue, V: CellValue, M: MapQuery<K, V>,

Source§

fn select<F>(self, predicate: F) -> SelectPlan<Self, K, V, F>
where F: Fn(&V) -> bool + Send + Sync + 'static,

Filters rows by value. Read more
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, 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> 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.