PreviewStageBoard
struct · ferroui-designer · v0.5.0
struct PreviewStageBoard
One UI-thread collection of native comparison stages across the host's open document buffers. It never owns document history or performs authored mutations.
Members
newepochactiveprototypeset_prototypestagesstagecontrolsync_sourcesaddupdateset_activeduplicateremovemove_stageset_pausedrefreshrefresh_allcompare_variantsadd_configurationsmanifestsnapshotrestore_manifestrestoreretarget_sourceruntime_treeprototype_hotspot_boundssource_is_currentframe_is_currentdependencies_are_currentrefresh_runtime_mappingsrefresh_runtime_mappingselection_tokenhit_test_selectionresolve_selection
new
fn new() -> Self
epoch
fn epoch(self: &Self) -> u64
active
fn active(self: &Self) -> Option<PreviewStageId>
prototype
fn prototype(self: &Self) -> PreviewPrototype
set_prototype
fn set_prototype(self: &mut Self, prototype: PreviewPrototype) -> Result<(), String>
Replace local interaction descriptors without rebuilding native stages or mutating authored source. Rejected graphs leave the accepted board intact.
stages
fn stages(self: &Self) -> Vec<PreviewStageInfo>
stage
fn stage(self: &Self, id: PreviewStageId) -> Option<PreviewStageInfo>
control
fn control(self: &Self, id: PreviewStageId) -> Option<Ref<Control>>
sync_sources
fn sync_sources(self: &mut Self, active_uri: &str, sources: Vec<PreviewStageSource>, options: PreviewHostOptions, options_epoch: u64) -> Result<(), String>
add
fn add(self: &mut Self, configuration: PreviewStageConfiguration) -> Result<PreviewStageId, String>
update
fn update(self: &mut Self, id: PreviewStageId, configuration: PreviewStageConfiguration) -> Result<(), String>
set_active
fn set_active(self: &mut Self, id: PreviewStageId) -> Result<(), String>
duplicate
fn duplicate(self: &mut Self, id: PreviewStageId) -> Result<PreviewStageId, String>
remove
fn remove(self: &mut Self, id: PreviewStageId) -> Result<(), String>
move_stage
fn move_stage(self: &mut Self, id: PreviewStageId, index: usize) -> Result<(), String>
set_paused
fn set_paused(self: &mut Self, id: PreviewStageId, paused: bool) -> Result<(), String>
refresh
fn refresh(self: &mut Self, id: PreviewStageId) -> Result<(), String>
Explicit refresh also works while automatic updates are paused.
refresh_all
fn refresh_all(self: &mut Self) -> Vec<(PreviewStageId, String)>
compare_variants
fn compare_variants(self: &mut Self, id: PreviewStageId, variants: Vec<(String, PreviewEnvironment)>) -> Result<Vec<PreviewStageId>, String>
Create variants atomically with respect to descriptor validation and capacity. Each native failure remains isolated to its resulting card.
add_configurations
fn add_configurations(self: &mut Self, configurations: Vec<PreviewStageConfiguration>) -> Result<Vec<PreviewStageId>, String>
Add a bounded comparison batch. Descriptor validation and capacity are checked for the entire batch before any native factory can be called. Individual native loading failures remain visible on their own cards.
manifest
fn manifest(self: &Self) -> PreviewStageManifest
snapshot
fn snapshot(self: &Self) -> PreviewStageSnapshot
restore_manifest
fn restore_manifest(self: &mut Self, manifest: PreviewStageManifest) -> Result<(), String>
Imported IDs are freshly allocated so callbacks from a retired board cannot address a new card. Validation finishes before any old stage is removed.
restore
fn restore(self: &mut Self, snapshot: PreviewStageSnapshot) -> Result<(), String>
retarget_source
fn retarget_source(self: &mut Self, old_uri: &str, new_uri: &str) -> Result<(), String>
Call after a successful Save As, before synchronizing the new URI snapshots. The old graph stays visible but immediately loses source-selection authority.
runtime_tree
fn runtime_tree(self: &Self, id: PreviewStageId, kind: TreeKind) -> Result<Vec<RuntimeNode>, String>
prototype_hotspot_bounds
fn prototype_hotspot_bounds(self: &Self, id: PreviewStageId, anchor: &PreviewSourceAnchor) -> Result<ferroui_base::Rect, String>
Resolve one authored hotspot against the exact accepted native graph. The returned axis-aligned rectangle uses stage logical coordinates and is clipped to the stage viewport and native ancestor clips. Call again immediately before activation: native scrolling and layout can move a target without source edits.
source_is_current
fn source_is_current(self: &Self, id: PreviewStageId, uri: &str, document: &Document, pending: bool, options_epoch: u64) -> bool
Validate a supplied current buffer without synchronizing, constructing or refreshing anything. Read-only automation uses this before exposing source identities when an editor change precedes the board's next UI refresh.
frame_is_current
fn frame_is_current(self: &Self, id: PreviewStageId, uri: &str, document: &Document, pending: bool, options_epoch: u64) -> bool
Check whether an accepted native frame represents these exact current
buffers, including a paused frame explicitly refreshed at this revision.
This does not grant source-selection or application-input authority.
Hosts must also validate all their current dependency buffers through
dependencies_are_current before publishing an image of the frame.
dependencies_are_current
fn dependencies_are_current(self: &Self, id: PreviewStageId, sources: &[PreviewStageSource]) -> bool
Read-only validation against all current host buffers, including native include dependencies changed before the board's next synchronization.
refresh_runtime_mappings
fn refresh_runtime_mappings(self: &mut Self)
Refresh identities after native attachment or template/item realization. This neither reloads source nor resets a stage's temporary interaction state.
refresh_runtime_mapping
fn refresh_runtime_mapping(self: &mut Self, id: PreviewStageId) -> Result<(), String>
Refresh only the presented screen. Prototype playback can retain many screens without traversing every hidden graph on each native layout tick. The same accepted-source/dependency checks apply as the whole-board update.
selection_token
fn selection_token(self: &Self, id: PreviewStageId, inspector_id: u64) -> Result<PreviewStageSelectionToken, String>
hit_test_selection
fn hit_test_selection(self: &Self, id: PreviewStageId, point: Point) -> Result<PreviewStageSelectionToken, String>
resolve_selection
fn resolve_selection(self: &Self, token: &PreviewStageSelectionToken) -> Result<PreviewStageSelection, String>
Trait implementations
SendSyncFreezeUnsafeUnpinUnpinUnwindSafeRefUnwindSafeBorrow<T>BorrowMut<T>Into<U>From<T>TryInto<U>TryFrom<U>AnyClassDefaultsErasedDestructorIntoEitherSameDefaultDrop
Availability
Extracted for aarch64-apple-darwin. Cargo features are listed in the crate index.