Skip to main content

Owner

Struct Owner 

Source
pub struct Owner { /* private fields */ }

Implementations§

Source§

impl Owner

Source

pub fn resource<K, T, E, F>( &self, source: impl Fn() -> K + 'static, load: impl Fn(K) -> F + 'static, ) -> Resource<K, T, E>
where K: Clone + PartialEq + 'static, T: 'static, E: 'static, F: Future<Output = Result<T, E>> + 'static,

Start/restart after tracked source-key changes at the effect phase. A missing Host produces Unavailable rather than a blocking fallback.

Source

pub fn resource_seeded<K, T, E, F>( &self, source: impl Fn() -> K + 'static, load: impl Fn(K) -> F + 'static, seed: Option<ResourceSeed<K, T, E>>, ) -> Resource<K, T, E>
where K: Clone + PartialEq + 'static, T: 'static, E: 'static, F: Future<Output = Result<T, E>> + 'static,

Source§

impl Owner

Source

pub fn keyed_list<K: Clone + Eq + Hash + 'static, T: 'static>( &self, initial: Vec<T>, key: impl Fn(&T) -> K + 'static, ) -> Result<KeyedList<K, T>, ListError>

Source§

impl Owner

Source

pub fn selector<K: Clone + Eq + Hash + 'static>( &self, source: Cage<Option<K>>, ) -> Result<Selector<K>, AccessError>

Source§

impl Owner

Source

pub fn enter<R>(&self, f: impl FnOnce() -> R) -> R

Derived maps created by this widget/factory belong to this owner, even when their source is application-wide. The context never owns data.

Source

pub fn runtime(&self) -> RuntimeId

Source

pub fn is_alive(&self) -> bool

Source

pub fn check_write(&self) -> Result<(), AccessError>

Check liveness and mutation permission before an adapter changes host state. This publishes nothing and does not reserve a later source write.

Source

pub fn child(&self) -> Self

Source

pub fn dispose(&self)

Source

pub fn on_cleanup( &self, cleanup: impl FnOnce() + 'static, ) -> Result<(), AccessError>

Run untracked after this Owner and its descendants have been invalidated. Implicit map/path construction remains in the retired Owner and fails; explicit entry into another live Owner is allowed. Callbacks run without graph borrows, in reverse registration order (children before parents). A panic unwinds normally; there is no catch/retry of remaining callbacks.

Source

pub fn cage<T: 'static>(&self, value: T) -> Cage<T>

Source

pub fn compute<T>(&self, f: impl FnOnce() -> T) -> Result<T, AccessError>

Synchronous, untracked pure computation under this live Owner. Allocates no reactive node. Both reads and unwind restore the outer tracking/mode/construction context; writes/creation remain forbidden.

Source

pub fn bond<T: 'static>(&self, mapper: impl Fn() -> T + 'static) -> Bond<T>

Source

pub fn binding(&self, callback: impl FnMut() + 'static) -> BindingId

Source

pub fn effect(&self, callback: impl FnMut() + 'static) -> BindingId

Effects run after currently queued bindings. Writes enqueue another pass; reads still form direct dependencies, and runaway loops fail explicitly.

Source

pub fn structural(&self, callback: impl FnMut() + 'static) -> BindingId

Structural controllers update owned row state before prop bindings run. Use this for tree control flow; ordinary computed props remain pure.

Source

pub fn task(&self) -> Task

Source

pub fn spawn( &self, future: impl Future<Output = ()> + 'static, ) -> Result<TaskToken, AccessError>

Trait Implementations§

Source§

impl Debug for Owner

Source§

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

Formats the value using the given formatter. Read more
Source§

impl Drop for Owner

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

fn pin_drop(self: Pin<&mut Self>)

🔬This is a nightly-only experimental API. (pin_ergonomics)
Execute the destructor for this type, but different to Drop::drop, it requires self to be pinned. Read more

Auto Trait Implementations§

§

impl !Send for Owner

§

impl !Sync for Owner

§

impl Forget for Owner

§

impl Freeze for Owner

§

impl Move for Owner

§

impl RefUnwindSafe for Owner

§

impl Unpin for Owner
where Rc<()>: Unpin,

§

impl UnsafeUnpin for Owner

§

impl UnwindSafe for Owner
where Rc<()>: UnwindSafe,

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