Skip to main content

Elem

Struct Elem 

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

One element of a keyed store, addressed by a key that survives reordering.

Implementations§

Source§

impl<T: Identified + 'static> Elem<T>

Source

pub fn key(self) -> u64

The path handle this element addresses: the raw form of Elem::model_id.

Source

pub fn model_id(self) -> ModelId<T>

The element’s typed id. (Named to stay clear of the id field accessor an inherent id() would shadow on every model that has one.)

Source

pub fn exists(self) -> bool

Whether the row is (still) present. Tracked, so a guard re-runs when the row is deleted or comes back. This is the deletion story: reads of a gone row return the field’s Default, and this is the one signal a page needs to degrade instead.

Trait Implementations§

Source§

impl<T> Clone for Elem<T>

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<T> Copy for Elem<T>

Source§

impl<T: Identified + 'static> Source<T> for Elem<T>

Source§

fn path(self) -> Path

The path this source occupies. Implementations revalidate against the interner, so the result is always current.
Source§

fn node(self) -> NodeId

This source’s interned id, so a child can be built with no lookup of its own. Read more
Source§

fn components(self, out: &mut Vec<u64>)

The path as plain components, resolved by walking the handle chain rather than the interner. This is what crosses a thread boundary: a worker names what it changed with components, and the main thread re-establishes them on its own side when it announces.
Source§

fn with_value_untracked<R>(self, f: impl FnOnce(Option<&T>) -> R) -> R

Source§

fn update_value(self, f: impl FnOnce(&mut T)) -> bool

Returns false when the value is gone (a deleted row), in which case nothing is announced either.
Source§

fn bump_version(self)

Source§

const DYNAMIC: bool = false

Whether this source’s location can change over the handle’s lifetime: a recycled list slot whose current row rotates. Fields projected from a dynamic source resolve their path through the source on every operation instead of trusting the one cached at projection time, and their tracked reads also run Source::track_extra.
Source§

fn track_extra(self)

Extra tracking a projected field’s tracked reads perform. A dynamic source tracks its own rebind signal here, so a control bound at build follows the slot to its next row.
Source§

fn with<R>(self, f: impl FnOnce(Option<&T>) -> R) -> R

Tracked read of the whole value: the coarse subscription.

Auto Trait Implementations§

§

impl<T> Freeze for Elem<T>

§

impl<T> RefUnwindSafe for Elem<T>

§

impl<T> Send for Elem<T>
where T: Send + Sync,

§

impl<T> Sync for Elem<T>
where T: Send + Sync,

§

impl<T> Unpin for Elem<T>

§

impl<T> UnsafeUnpin for Elem<T>

§

impl<T> UnwindSafe for Elem<T>

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