pub struct MemoryNativeMenuBackend { /* private fields */ }Expand description
Recording backend for headless tests. Captures the snapshot set per window,
which window is active, item deltas, and cleared windows. Cloneable; clones
share the recording so a test can keep a clone after handing one to
NativeMenuHandle::new.
Implementations§
Source§impl MemoryNativeMenuBackend
impl MemoryNativeMenuBackend
The snapshot currently set for window_id, if any.
Sourcepub fn active_window(&self) -> Option<TeksiloWindowId>
pub fn active_window(&self) -> Option<TeksiloWindowId>
The window whose menu is active (last activate_window, or the window
of the most recent set_window_menu if none was activated).
Sourcepub fn deltas(&self) -> Vec<(MenuItemId, MenuItemDelta)>
pub fn deltas(&self) -> Vec<(MenuItemId, MenuItemDelta)>
All item deltas applied so far, in order.
Sourcepub fn cleared(&self) -> Vec<TeksiloWindowId>
pub fn cleared(&self) -> Vec<TeksiloWindowId>
Windows whose menus were cleared, in order.
Trait Implementations§
Source§impl Clone for MemoryNativeMenuBackend
impl Clone for MemoryNativeMenuBackend
Source§fn clone(&self) -> MemoryNativeMenuBackend
fn clone(&self) -> MemoryNativeMenuBackend
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Default for MemoryNativeMenuBackend
impl Default for MemoryNativeMenuBackend
Source§fn default() -> MemoryNativeMenuBackend
fn default() -> MemoryNativeMenuBackend
Returns the “default value” for a type. Read more
Source§impl NativeMenuBackend for MemoryNativeMenuBackend
impl NativeMenuBackend for MemoryNativeMenuBackend
Build (or replace) the native menu for
window_id from menu. For
every item the user later chooses, the backend MUST post a
NativeMenuEventPayload — with window_id_owner == window_id —
through poster. If window_id is (or becomes) the active window, the
backend should also make this menu the visible one.Source§fn activate_window(&mut self, window_id: TeksiloWindowId)
fn activate_window(&mut self, window_id: TeksiloWindowId)
Make
window_id’s previously-set menu the active/visible one (focus
follows window). No-op if that window never set a menu.Source§fn clear_window(&mut self, window_id: TeksiloWindowId)
fn clear_window(&mut self, window_id: TeksiloWindowId)
Forget
window_id’s menu (window closed).Source§fn update_item(&mut self, id: MenuItemId, delta: MenuItemDelta)
fn update_item(&mut self, id: MenuItemId, delta: MenuItemDelta)
Apply a reactive delta to a single already-installed item.
Auto Trait Implementations§
impl !RefUnwindSafe for MemoryNativeMenuBackend
impl !Send for MemoryNativeMenuBackend
impl !Sync for MemoryNativeMenuBackend
impl !UnwindSafe for MemoryNativeMenuBackend
impl Freeze for MemoryNativeMenuBackend
impl Unpin for MemoryNativeMenuBackend
impl UnsafeUnpin for MemoryNativeMenuBackend
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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.