Skip to main content

Selector

Struct Selector 

Source
pub struct Selector<K: 'static> { /* private fields */ }
Expand description

An Owner-owned index for a single selected key (Cage<Option<K>>).

selected(key) creates one read-only selection handle per live key/Owner, owned by the current construction Owner (or the selector Owner outside construction). Reads subscribe to that channel, not the shared selection. A flush normally notifies only the old and new key’s live channels; batched changes coalesce to the final key. Channels actually read ahead of a flush are also notified once, including after a net-zero batch, to invalidate any cached intermediate result. Direct Selected::get reads compare against the current source, including inside a batch before notification. This is not a general predicate selector. Bind through computed(move || selected.get()); this dedicated handle does not implicitly convert to Vary<bool>. A derived Bond caching a selection read is invalidated by the flush-time notification, so it may retain its previous value until that flush. Use the Selected handle directly when reading intermediate, unflushed writes.

Keys must have pure, stable Clone/Hash/Eq implementations. Hash collisions compare complete keys outside graph/index borrows. Storage contains only live registered channels; retirement removes empty buckets. Handles are local, non-owning, invalid after their creating Owner retires. Register channels during construction, not inside pure computations.

Implementations§

Source§

impl<K: Clone + Eq + Hash + 'static> Selector<K>

Source

pub fn selected(self, key: K) -> Selected<K>

Source

pub fn try_selected(self, key: K) -> Result<Selected<K>, AccessError>

Source

pub fn stats(self) -> Result<SelectorStats, AccessError>

Explicit O(live channels) diagnostics; no source or visited-key scan.

Trait Implementations§

Source§

impl<K> Clone for Selector<K>

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> Copy for Selector<K>

Auto Trait Implementations§

§

impl<K> !RefUnwindSafe for Selector<K>

§

impl<K> !Send for Selector<K>

§

impl<K> !Sync for Selector<K>

§

impl<K> !UnwindSafe for Selector<K>

§

impl<K> Forget for Selector<K>

§

impl<K> Freeze for Selector<K>
where PhantomData<Rc<Rc<Control<K>>>>: Freeze,

§

impl<K> Move for Selector<K>

§

impl<K> Unpin for Selector<K>
where Rc<Rc<Control<K>>>: Unpin,

§

impl<K> UnsafeUnpin for Selector<K>
where PhantomData<Rc<Rc<Control<K>>>>: UnsafeUnpin,

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

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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> 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 = !

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

fn try_from(value: U) -> Result<T, !>

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.