Skip to main content

SheetHandle

Struct SheetHandle 

Source
pub struct SheetHandle { /* private fields */ }
Expand description

Shares a scope-owned model; copying a handle does not copy its model or journal.

Signals track accepted publications, while checked borrows reject reentrancy. Handles make no Send or Sync promise and expire with their Dioxus scope.

§Examples

See use_sheet for initialization and a bound editor.

Implementations§

Source§

impl SheetHandle

Source

pub fn new( factory: ModelFactory, schema_key: String, on_outcome: EventHandler<SheetEvent>, ) -> Result<Self, BuildError>

Constructs a scope-owned handle without installing a failed model.

Call once during scope initialization, or prefer use_sheet.

§Errors

Returns the factory’s construction or initial publication error.

  • Complexity: Factory and publication cost.
§Examples

See use_sheet; SheetHandle::new uses the same arguments inside a hook.

Source

pub fn from_owner( owner: SheetOwner, on_outcome: EventHandler<SheetEvent>, ) -> Self

Adopts an owner without rebuilding or duplicating its model.

Call in a mounted Dioxus scope; this transfers its journal, recordings and availability state. A discarded or retired owner stays unavailable.

§Examples

See SheetOwner for construction; inside a hook call SheetHandle::from_owner(owner, EventHandler::new(|_| {})).

Source

pub fn instance(&self) -> u64

Returns the reactive instance identity used to key replacement controls.

§Examples

See Self::replace; a successful replacement changes sheet.instance().

Source

pub fn cell(&self, name: &str) -> CellBinding

Creates a symbolic binding owned by this exact model installation.

Lookup errors are returned by CellBinding::view, not hidden here.

  • Complexity: O(name bytes).
§Examples

See use_sheet; sheet.cell("x") binds the named cell.

Source

pub fn apply(&self, edits: &[CellEdit], origin: UpdateOrigin)

Submits an ordered group and delivers each structured outcome to the host.

Reentrant access rejects without invoking the transaction. Rejections that discard a candidate retire its bindings; recovery installs a new instance. Reentrant outcomes wait until every enclosing owner borrow ends, then drain in submission order without recursive callback invocation.

  • Complexity: Transaction/publication cost plus queued callback work.
§Examples

See SheetOwner for CellEdit groups; call sheet.apply(&edits, UpdateOrigin::User).

Source

pub fn restore_accepted(&self) -> Result<(), BuildError>

Restores accepted aspirations only at the host’s explicit request.

§Errors

Returns typed reconstruction, fatal retirement, or reentrancy errors.

  • Complexity: Factory, journal replay, publication, and queued callback cost.
§Examples

See SheetEvent for explicit host recovery.

Source

pub fn with_accepted_state<R>( &self, f: impl FnOnce(&RecoveryState) -> R, ) -> Result<R, BindingError>

Borrows the single accepted journal, including after rejection or retirement.

§Errors

Returns ReentrantMutation without invoking f while a mutation owns it. Writes attempted inside f likewise reject without changing the journal. Outcomes submitted inside f reach the host after f returns.

  • Complexity: O(1) plus callback and queued outcome delivery cost; does not copy history.
§Examples

See use_sheet; sheet.with_accepted_state(|s| s.transactions.len()) returns the number of accepted groups.

Source

pub fn inspect<R>( &self, f: impl FnOnce(&ParsedSheet, &Labels) -> R, ) -> Result<R, BindingError>

Tracks a read of an accepted live model without exposing mutable ownership.

§Errors

Returns unavailable, retired, or reentrant diagnostics without calling f. Outcomes submitted inside f reach the host after f returns.

  • Complexity: O(1) plus callback and queued outcome delivery cost.
§Examples

See use_sheet; sheet.inspect(|parsed, _| parsed.cell_names.len()) counts named cells, and can project application-specific graph data.

Source

pub fn capture(&self, result_keys: &[&str]) -> Result<Recording, CaptureError>

Captures exact effective sources from the accepted live model.

§Errors

Returns capture capability, encoding, availability, or reentrancy failures.

  • Complexity: Source analysis, encoded bytes, and queued callback cost.
§Examples

See use_sheet; sheet.capture(&["x"]) selects the named result.

Source

pub fn start_recording(&self, result_keys: &[&str]) -> Result<(), CaptureError>

Enables capture for subsequent accepted user actions without cloning history.

§Errors

Returns capture validation, availability, or reentrancy errors.

  • Complexity: Capture cost, selected-key bytes, and queued callback cost.
§Examples

See use_sheet; sheet.start_recording(&["x"]) starts action capture.

Source

pub fn stop_recording(&self)

Stops recording, reporting contention through the host outcome boundary.

  • Complexity: O(selected-key bytes) destruction plus queued callback cost.
§Examples

See Self::start_recording; call sheet.stop_recording() to stop capture.

Source

pub fn last_recording(&self) -> Option<Rc<Recording>>

Returns the latest immutable recording without copying its values.

Contention reports a structured host outcome and returns no recording.

  • Complexity: O(1) plus queued callback cost.
§Examples

See Self::start_recording; before an action sheet.last_recording().is_none().

Source

pub fn replace( &self, factory: ModelFactory, schema_key: String, ) -> Result<(), BuildError>

Installs a fully validated replacement and retires all prior bindings on success.

§Errors

Returns construction or reentrancy errors, preserving the prior owner. A fatal owner rejects replacement without invoking the factory.

  • Complexity: Factory/publication cost, old-model destruction, and queued callback cost.
§Examples

See use_sheet; sheet.replace(factory, "s/v2".into()) replaces explicitly.

Source

pub fn install(&self, candidate: SheetOwner) -> Result<(), BindingError>

Adopts a prevalidated replacement and retires the preceding installation.

This avoids rebuilding a candidate already checked by a host’s load path.

§Errors

Returns candidate availability, fatal retirement, or reentrancy errors without replacing the current owner.

  • Complexity: Old model/history destruction, O(1) owner transfer, and queued callback cost.
§Examples

See Self::from_owner; sheet.install(owner) installs a validated load.

Source

pub fn playback( &self, factory: ModelFactory, schema_key: String, recording: &Recording, ) -> Result<(), PlaybackError>

Installs a fresh successfully replayed owner without recording playback as a user edit.

§Errors

Returns compatibility, construction, playback or reentrancy errors; failed replay leaves the prior owner installed. A retired owner never invokes the factory.

  • Complexity: Factory, replay, publication, old-model destruction, and queued callback cost.
§Examples

See Self::capture; pass its recording to sheet.playback(factory, "s/v1".into(), &recording).

Source

pub fn views(&self) -> Result<Vec<Rc<CellView>>, BindingError>

Copies shared view references, never the accepted history.

§Errors

Returns an owner-state or reentrancy error without inspecting a failed model.

  • Complexity: O(named cells) time and space plus queued callback cost.
§Examples

See use_sheet; sheet.views() enumerates accepted published cells.

Trait Implementations§

Source§

impl Clone for SheetHandle

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 Copy for SheetHandle

Source§

impl PartialEq for SheetHandle

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for SheetHandle

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<S, D, Swp, Dwp, T> AdaptInto<D, Swp, Dwp, T> for S
where T: Real + Zero + Arithmetics + Clone, Swp: WhitePoint<T>, Dwp: WhitePoint<T>, D: AdaptFrom<S, Swp, Dwp, T>,

Source§

fn adapt_into_using<M>(self, method: M) -> D
where M: TransformMatrix<T>,

👎Deprecated since 0.7.7:

replaced by palette::chromatic_adaptation::AdaptIntoUnclamped

Convert the source color to the destination color using the specified method.
Source§

fn adapt_into(self) -> D

👎Deprecated since 0.7.7:

replaced by palette::chromatic_adaptation::AdaptIntoUnclamped

Convert the source color to the destination color using the bradford method by default.
Source§

impl<T, C> AdaptIntoUnclamped<T> for C
where T: AdaptFromUnclamped<C>,

Source§

type Scalar = <T as AdaptFromUnclamped<C>>::Scalar

The number type that’s used as the color’s components.
Source§

fn adapt_into_unclamped_with<M>(self) -> T

Adapt a color of type Self into a color of type T, using the custom matrix M. Read more
Source§

fn adapt_into_unclamped(self) -> T
where Bradford: LmsToXyz<Self::Scalar> + XyzToLms<Self::Scalar>,

Adapt a color of type Self into a color of type T, using the Bradford matrix. Read more
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, C> ArraysFrom<C> for T
where C: IntoArrays<T>,

Source§

fn arrays_from(colors: C) -> T

Cast a collection of colors into a collection of arrays.
Source§

impl<T, C> ArraysInto<C> for T
where C: FromArrays<T>,

Source§

fn arrays_into(self) -> C

Cast this collection of arrays into a collection of colors.
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<WpParam, T, U> Cam16IntoUnclamped<WpParam, T> for U
where T: FromCam16Unclamped<WpParam, U>,

Source§

type Scalar = <T as FromCam16Unclamped<WpParam, U>>::Scalar

The number type that’s used in parameters when converting.
Source§

fn cam16_into_unclamped( self, parameters: BakedParameters<WpParam, <U as Cam16IntoUnclamped<WpParam, T>>::Scalar>, ) -> T

Converts self into C, using the provided parameters.
§

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,

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, C> ComponentsFrom<C> for T
where C: IntoComponents<T>,

Source§

fn components_from(colors: C) -> T

Cast a collection of colors into a collection of color components.
§

impl<T> DependencyElement for T
where T: 'static + PartialEq + Clone,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> FromAngle<T> for T

Source§

fn from_angle(angle: T) -> T

Performs a conversion from angle.
Source§

impl<T, U> FromStimulus<U> for T
where U: IntoStimulus<T>,

Source§

fn from_stimulus(other: U) -> T

Converts other into Self, while performing the appropriate scaling, rounding and clamping.
§

impl<T> InitializeFromFunction<T> for T

§

fn initialize_from_function(f: fn() -> T) -> T

Create an instance of this type from an initialization function
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. 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, U> IntoAngle<U> for T
where U: FromAngle<T>,

Source§

fn into_angle(self) -> U

Performs a conversion into T.
Source§

impl<WpParam, T, U> IntoCam16Unclamped<WpParam, T> for U
where T: Cam16FromUnclamped<WpParam, U>,

Source§

type Scalar = <T as Cam16FromUnclamped<WpParam, U>>::Scalar

The number type that’s used in parameters when converting.
Source§

fn into_cam16_unclamped( self, parameters: BakedParameters<WpParam, <U as IntoCam16Unclamped<WpParam, T>>::Scalar>, ) -> T

Converts self into C, using the provided parameters.
Source§

impl<T, U> IntoColor<U> for T
where U: FromColor<T>,

Source§

fn into_color(self) -> U

Convert into T with values clamped to the color defined bounds Read more
Source§

impl<T, U> IntoColorUnclamped<U> for T
where U: FromColorUnclamped<T>,

Source§

fn into_color_unclamped(self) -> U

Convert into T. The resulting color might be invalid in its color space Read more
Source§

impl<T> IntoStimulus<T> for T

Source§

fn into_stimulus(self) -> T

Converts self into T, while performing the appropriate scaling, rounding and clamping.
§

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

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
§

impl<Ret> SpawnIfAsync<(), Ret> for Ret

§

fn spawn(self) -> Ret

Spawn the value into the dioxus runtime if it is an async block
§

impl<T, O> SuperFrom<T> for O
where O: From<T>,

§

fn super_from(input: T) -> O

Convert from a type to another type.
§

impl<T, O, M> SuperInto<O, M> for T
where O: SuperFrom<T, M>,

§

fn super_into(self) -> O

Convert from a type to another type.
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, C> TryComponentsInto<C> for T
where C: TryFromComponents<T>,

Source§

type Error = <C as TryFromComponents<T>>::Error

The error for when try_into_colors fails to cast.
Source§

fn try_components_into(self) -> Result<C, <T as TryComponentsInto<C>>::Error>

Try to cast this collection of color components into a collection of colors. 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.
Source§

impl<T, U> TryIntoColor<U> for T
where U: TryFromColor<T>,

Source§

fn try_into_color(self) -> Result<U, OutOfBounds<U>>

Convert into T, returning ok if the color is inside of its defined range, otherwise an OutOfBounds error is returned which contains the unclamped color. Read more
Source§

impl<C, U> UintsFrom<C> for U
where C: IntoUints<U>,

Source§

fn uints_from(colors: C) -> U

Cast a collection of colors into a collection of unsigned integers.
Source§

impl<C, U> UintsInto<C> for U
where C: FromUints<U>,

Source§

fn uints_into(self) -> C

Cast this collection of unsigned integers into a collection of colors.
Source§

impl<S, T> Upcast<T> for S
where T: UpcastFrom<S> + ?Sized, S: ?Sized,

Source§

fn upcast(&self) -> &T
where Self: ErasableGeneric, T: Sized + ErasableGeneric<Repr = Self::Repr>,

Perform a zero-cost type-safe upcast to a wider ref type within the Wasm bindgen generics type system. Read more
Source§

fn upcast_into(self) -> T
where Self: Sized + ErasableGeneric, T: Sized + ErasableGeneric<Repr = Self::Repr>,

Perform a zero-cost type-safe upcast to a wider type within the Wasm bindgen generics type system. Read more
§

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

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more