Skip to main content

SiteDeps

Struct SiteDeps 

Source
pub struct SiteDeps {
    pub path: String,
    pub kind: SiteKind,
    pub dynamic: bool,
    pub reads: BTreeSet<Symbol>,
    pub prop_reads: BTreeSet<Symbol>,
}
Expand description

One addressable place in a view that can change, and what it depends on.

Fields§

§path: String

Dotted child indices from the view root — the patcher’s address for the node.

§kind: SiteKind§dynamic: bool

Does this site live under an {if}, a {for each} or an {inspect}?

A site under control flow has no single node: a loop body renders once PER ITEM, and an arm renders only while its condition holds. Its static path therefore names a shape rather than a node, so an in-place patch cannot address it and the update falls back to rebuilding. Marked here, where the walk already knows, rather than re-derived from the path string — a path is not a reliable record of how it was produced.

§reads: BTreeSet<Symbol>

State fields, already closed over derived fields and template bindings.

§prop_reads: BTreeSet<Symbol>

Props read here. Separate because a prop cannot change without the PARENT re-rendering this component, so it is not something this instance’s own turns can invalidate.

Implementations§

Source§

impl SiteDeps

Source

pub fn key(&self, interner: &Interner) -> String

kind@path — the site’s identity, and the KEY a renderer records its node under.

The dependency walk and the render walk are two walks over one tree, and two walks drift. Making them agree on a STRING means the agreement can be asserted directly rather than hoped for: a renderer that numbered a child differently records a key the graph never names, and the lock says so.

Source

pub fn patchable(&self) -> bool

Can a turn update this site IN PLACE, without rebuilding anything?

Only a value-shaped site under no control flow: it names exactly one node that exists for as long as the component is mounted. An {if} or a {for each} MOUNTS and UNMOUNTS subtrees, which is a different operation from writing a value into a node that is already there.

Trait Implementations§

Source§

impl Clone for SiteDeps

Source§

fn clone(&self) -> SiteDeps

Returns a duplicate of the value. Read more
1.0.0 · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for SiteDeps

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

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

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,