pub struct SheetHandle { /* private fields */ }Expand description
Implementations§
Source§impl SheetHandle
impl SheetHandle
Sourcepub fn new(
factory: ModelFactory,
schema_key: String,
on_outcome: EventHandler<SheetEvent>,
) -> Result<Self, BuildError>
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.
Sourcepub fn from_owner(
owner: SheetOwner,
on_outcome: EventHandler<SheetEvent>,
) -> Self
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(|_| {})).
Sourcepub fn instance(&self) -> u64
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().
Sourcepub fn cell(&self, name: &str) -> CellBinding
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.
Sourcepub fn apply(&self, edits: &[CellEdit], origin: UpdateOrigin)
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).
Sourcepub fn restore_accepted(&self) -> Result<(), BuildError>
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.
Sourcepub fn with_accepted_state<R>(
&self,
f: impl FnOnce(&RecoveryState) -> R,
) -> Result<R, BindingError>
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.
Sourcepub fn inspect<R>(
&self,
f: impl FnOnce(&ParsedSheet, &Labels) -> R,
) -> Result<R, BindingError>
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.
Sourcepub fn capture(&self, result_keys: &[&str]) -> Result<Recording, CaptureError>
pub fn capture(&self, result_keys: &[&str]) -> Result<Recording, CaptureError>
Sourcepub fn start_recording(&self, result_keys: &[&str]) -> Result<(), CaptureError>
pub fn start_recording(&self, result_keys: &[&str]) -> Result<(), CaptureError>
Sourcepub fn stop_recording(&self)
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.
Sourcepub fn last_recording(&self) -> Option<Rc<Recording>>
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().
Sourcepub fn replace(
&self,
factory: ModelFactory,
schema_key: String,
) -> Result<(), BuildError>
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.
Sourcepub fn install(&self, candidate: SheetOwner) -> Result<(), BindingError>
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.
Sourcepub fn playback(
&self,
factory: ModelFactory,
schema_key: String,
recording: &Recording,
) -> Result<(), PlaybackError>
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).
Trait Implementations§
Source§impl Clone for SheetHandle
impl Clone for SheetHandle
impl Copy for SheetHandle
Source§impl PartialEq for SheetHandle
impl PartialEq for SheetHandle
impl StructuralPartialEq for SheetHandle
Auto Trait Implementations§
impl !RefUnwindSafe for SheetHandle
impl !Send for SheetHandle
impl !Sync for SheetHandle
impl !UnwindSafe for SheetHandle
impl Freeze for SheetHandle
impl Unpin for SheetHandle
impl UnsafeUnpin for SheetHandle
Blanket Implementations§
Source§impl<S, D, Swp, Dwp, T> AdaptInto<D, Swp, Dwp, T> for Swhere
T: Real + Zero + Arithmetics + Clone,
Swp: WhitePoint<T>,
Dwp: WhitePoint<T>,
D: AdaptFrom<S, Swp, Dwp, T>,
impl<S, D, Swp, Dwp, T> AdaptInto<D, Swp, Dwp, T> for Swhere
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) -> Dwhere
M: TransformMatrix<T>,
fn adapt_into_using<M>(self, method: M) -> Dwhere
M: TransformMatrix<T>,
replaced by palette::chromatic_adaptation::AdaptIntoUnclamped
Source§fn adapt_into(self) -> D
fn adapt_into(self) -> D
replaced by palette::chromatic_adaptation::AdaptIntoUnclamped
Source§impl<T, C> AdaptIntoUnclamped<T> for Cwhere
T: AdaptFromUnclamped<C>,
impl<T, C> AdaptIntoUnclamped<T> for Cwhere
T: AdaptFromUnclamped<C>,
Source§type Scalar = <T as AdaptFromUnclamped<C>>::Scalar
type Scalar = <T as AdaptFromUnclamped<C>>::Scalar
Source§fn adapt_into_unclamped_with<M>(self) -> Twhere
M: LmsToXyz<<C as AdaptIntoUnclamped<T>>::Scalar> + XyzToLms<<C as AdaptIntoUnclamped<T>>::Scalar>,
fn adapt_into_unclamped_with<M>(self) -> Twhere
M: LmsToXyz<<C as AdaptIntoUnclamped<T>>::Scalar> + XyzToLms<<C as AdaptIntoUnclamped<T>>::Scalar>,
Source§impl<T, C> ArraysFrom<C> for Twhere
C: IntoArrays<T>,
impl<T, C> ArraysFrom<C> for Twhere
C: IntoArrays<T>,
Source§fn arrays_from(colors: C) -> T
fn arrays_from(colors: C) -> T
Source§impl<T, C> ArraysInto<C> for Twhere
C: FromArrays<T>,
impl<T, C> ArraysInto<C> for Twhere
C: FromArrays<T>,
Source§fn arrays_into(self) -> C
fn arrays_into(self) -> C
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<WpParam, T, U> Cam16IntoUnclamped<WpParam, T> for Uwhere
T: FromCam16Unclamped<WpParam, U>,
impl<WpParam, T, U> Cam16IntoUnclamped<WpParam, T> for Uwhere
T: FromCam16Unclamped<WpParam, U>,
Source§type Scalar = <T as FromCam16Unclamped<WpParam, U>>::Scalar
type Scalar = <T as FromCam16Unclamped<WpParam, U>>::Scalar
parameters when converting.Source§fn cam16_into_unclamped(
self,
parameters: BakedParameters<WpParam, <U as Cam16IntoUnclamped<WpParam, T>>::Scalar>,
) -> T
fn cam16_into_unclamped( self, parameters: BakedParameters<WpParam, <U as Cam16IntoUnclamped<WpParam, T>>::Scalar>, ) -> T
self into C, using the provided parameters.impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T, C> ComponentsFrom<C> for Twhere
C: IntoComponents<T>,
impl<T, C> ComponentsFrom<C> for Twhere
C: IntoComponents<T>,
Source§fn components_from(colors: C) -> T
fn components_from(colors: C) -> T
impl<T> DependencyElement for T
Source§impl<T> FromAngle<T> for T
impl<T> FromAngle<T> for T
Source§fn from_angle(angle: T) -> T
fn from_angle(angle: T) -> T
angle.Source§impl<T, U> FromStimulus<U> for Twhere
U: IntoStimulus<T>,
impl<T, U> FromStimulus<U> for Twhere
U: IntoStimulus<T>,
Source§fn from_stimulus(other: U) -> T
fn from_stimulus(other: U) -> T
other into Self, while performing the appropriate scaling,
rounding and clamping.§impl<T> InitializeFromFunction<T> for T
impl<T> InitializeFromFunction<T> for T
§fn initialize_from_function(f: fn() -> T) -> T
fn initialize_from_function(f: fn() -> T) -> T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§impl<T, U> IntoAngle<U> for Twhere
U: FromAngle<T>,
impl<T, U> IntoAngle<U> for Twhere
U: FromAngle<T>,
Source§fn into_angle(self) -> U
fn into_angle(self) -> U
T.Source§impl<WpParam, T, U> IntoCam16Unclamped<WpParam, T> for Uwhere
T: Cam16FromUnclamped<WpParam, U>,
impl<WpParam, T, U> IntoCam16Unclamped<WpParam, T> for Uwhere
T: Cam16FromUnclamped<WpParam, U>,
Source§type Scalar = <T as Cam16FromUnclamped<WpParam, U>>::Scalar
type Scalar = <T as Cam16FromUnclamped<WpParam, U>>::Scalar
parameters when converting.Source§fn into_cam16_unclamped(
self,
parameters: BakedParameters<WpParam, <U as IntoCam16Unclamped<WpParam, T>>::Scalar>,
) -> T
fn into_cam16_unclamped( self, parameters: BakedParameters<WpParam, <U as IntoCam16Unclamped<WpParam, T>>::Scalar>, ) -> T
self into C, using the provided parameters.Source§impl<T, U> IntoColor<U> for Twhere
U: FromColor<T>,
impl<T, U> IntoColor<U> for Twhere
U: FromColor<T>,
Source§fn into_color(self) -> U
fn into_color(self) -> U
Source§impl<T, U> IntoColorUnclamped<U> for Twhere
U: FromColorUnclamped<T>,
impl<T, U> IntoColorUnclamped<U> for Twhere
U: FromColorUnclamped<T>,
Source§fn into_color_unclamped(self) -> U
fn into_color_unclamped(self) -> U
Source§impl<T> IntoStimulus<T> for T
impl<T> IntoStimulus<T> for T
Source§fn into_stimulus(self) -> T
fn into_stimulus(self) -> T
self into T, while performing the appropriate scaling,
rounding and clamping.impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
§impl<T, O> SuperFrom<T> for Owhere
O: From<T>,
impl<T, O> SuperFrom<T> for Owhere
O: From<T>,
§fn super_from(input: T) -> O
fn super_from(input: T) -> O
§impl<T, O, M> SuperInto<O, M> for Twhere
O: SuperFrom<T, M>,
impl<T, O, M> SuperInto<O, M> for Twhere
O: SuperFrom<T, M>,
§fn super_into(self) -> O
fn super_into(self) -> O
Source§impl<T, C> TryComponentsInto<C> for Twhere
C: TryFromComponents<T>,
impl<T, C> TryComponentsInto<C> for Twhere
C: TryFromComponents<T>,
Source§type Error = <C as TryFromComponents<T>>::Error
type Error = <C as TryFromComponents<T>>::Error
try_into_colors fails to cast.Source§fn try_components_into(self) -> Result<C, <T as TryComponentsInto<C>>::Error>
fn try_components_into(self) -> Result<C, <T as TryComponentsInto<C>>::Error>
Source§impl<T, U> TryIntoColor<U> for Twhere
U: TryFromColor<T>,
impl<T, U> TryIntoColor<U> for Twhere
U: TryFromColor<T>,
Source§fn try_into_color(self) -> Result<U, OutOfBounds<U>>
fn try_into_color(self) -> Result<U, OutOfBounds<U>>
OutOfBounds error is returned which contains
the unclamped color. Read more