pub struct MemoryFileDialog { /* private fields */ }Expand description
In-memory deterministic backend for headless tests. Holds a
scripted queue of pre-canned FileDialogResults that pop in
submission order. Each dispatch call pops one result and
immediately posts it through the supplied poster — handy for
tests that drive the event loop one tick at a time.
Implementations§
Source§impl MemoryFileDialog
impl MemoryFileDialog
Sourcepub fn new() -> Self
pub fn new() -> Self
Build a new empty mock backend. Use Self::enqueue to
script per-call results.
Sourcepub fn enqueue(&mut self, r: FileDialogResult)
pub fn enqueue(&mut self, r: FileDialogResult)
Push a result onto the FIFO queue. Each dispatch call pops
the front of the queue.
Trait Implementations§
Source§impl Default for MemoryFileDialog
impl Default for MemoryFileDialog
Source§impl FileDialogBackend for MemoryFileDialog
impl FileDialogBackend for MemoryFileDialog
Source§fn dispatch(
&mut self,
request_id: RequestId,
window_id: TeksiloWindowId,
_request: FileDialogRequest,
poster: Arc<dyn AppEventPoster>,
)
fn dispatch( &mut self, request_id: RequestId, window_id: TeksiloWindowId, _request: FileDialogRequest, poster: Arc<dyn AppEventPoster>, )
Spawn an async pick/save/folder request. The backend MUST
eventually deliver the result by calling
AppEventPoster::post_external
on the supplied poster, with a boxed FileDialogEventPayload
whose request_id matches the argument and whose
window_id_owner is set to window_id.Auto Trait Implementations§
impl Freeze for MemoryFileDialog
impl RefUnwindSafe for MemoryFileDialog
impl Send for MemoryFileDialog
impl Sync for MemoryFileDialog
impl Unpin for MemoryFileDialog
impl UnsafeUnpin for MemoryFileDialog
impl UnwindSafe for MemoryFileDialog
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
Mutably borrows from an owned value. Read more
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>
Convert
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>
Convert
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)
Convert
&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)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.