pub struct FileDialog { /* private fields */ }Expand description
The reusable file dialog — transient UI buffers + the current document
identity; the model itself lives in EngineState’s history.
Implementations§
Source§impl FileDialog
impl FileDialog
Sourcepub fn new() -> Self
pub fn new() -> Self
A closed dialog with empty buffers. Document identity (name + clean
baseline) lives on Document, so there is nothing to seed here.
Sourcepub fn save_generation(&self) -> u64
pub fn save_generation(&self) -> u64
The monotonic successful-save counter — the shell feeds it to the update-components checker as half its staleness key.
Sourcepub fn dispatch(
&mut self,
action: FileAction,
docs: &mut Documents,
store: &dyn ModelStore,
)
pub fn dispatch( &mut self, action: FileAction, docs: &mut Documents, store: &dyn ModelStore, )
Act on a toolbar file button. New acts immediately (it adds a tab, so there is nothing to discard); all browsing flows use the same in-app modal on both platforms.
Sourcepub fn show(
&mut self,
ctx: &Context,
docs: &mut Documents,
store: &dyn ModelStore,
)
pub fn show( &mut self, ctx: &Context, docs: &mut Documents, store: &dyn ModelStore, )
Draw the modal (if open) and pick up any completed async import. Called every frame by the shell with a ctx-level handle (the modal is ctx-level, like the command palette).
Sourcepub fn request_close(&mut self, docs: &mut Documents, index: usize)
pub fn request_close(&mut self, docs: &mut Documents, index: usize)
CLOSE tab index with the unsaved-changes contract: a DIRTY document
prompts to discard first (the confirm modal); a clean one closes
immediately. The tab strip’s \u{2715} routes here — it is the only
door through which unsaved work can be dropped, so it is the only one
that asks.
Sourcepub fn open_document(
&mut self,
docs: &mut Documents,
store: &dyn ModelStore,
name: &str,
)
pub fn open_document( &mut self, docs: &mut Documents, store: &dyn ModelStore, name: &str, )
Open — read a stored document into its own tab (or focus the tab already holding it). The one door every open lane uses: File>Open, the Edit-Part flow, and the session restore’s siblings.
Sourcepub fn take_stl_import(&mut self) -> Option<(String, Vec<u8>)>
pub fn take_stl_import(&mut self) -> Option<(String, Vec<u8>)>
Selecting an STL starts a preview session; only its Accept action edits the destination document.
Sourcepub fn file_state_json(
&self,
docs: &Documents,
store: &dyn ModelStore,
) -> String
pub fn file_state_json( &self, docs: &Documents, store: &dyn ModelStore, ) -> String
The published state for the headed verifier: current name, dirty flag, backend label, the stored-document list, and the modal’s open/mode.
Auto Trait Implementations§
impl Freeze for FileDialog
impl RefUnwindSafe for FileDialog
impl Send for FileDialog
impl Sync for FileDialog
impl Unpin for FileDialog
impl UnsafeUnpin for FileDialog
impl UnwindSafe for FileDialog
Blanket Implementations§
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more