pub struct Instances<M: SurfaceModel> { /* private fields */ }Expand description
The instances of a pane.footer or pane.header surface (one per pane
the viewer shows, named <surface>@<pane>) or of a machine.after
surface (one per machine, <surface>@<machine>). Pass every event to
Instances::event; it creates an instance’s surface when the viewer
first sizes it and drops it when the viewer removes it (a zero-size
resize), and says which pane or machine changed.
Implementations§
Source§impl<M: SurfaceModel> Instances<M>
impl<M: SurfaceModel> Instances<M>
Sourcepub fn event(&mut self, event: &Event) -> Option<String>
pub fn event(&mut self, event: &Event) -> Option<String>
Follows the viewer: returns the pane whose instance the event is about (created, resized, shown, hidden or removed), if any.
pub fn get_mut(&mut self, pane: &str) -> Option<&mut Surface<M>>
Sourcepub fn instance(&mut self, owner: &str) -> &mut Surface<M>
pub fn instance(&mut self, owner: &str) -> &mut Surface<M>
The instance of owner (a pane, machine or project id), created when
the viewer has not shown it yet: a machine or project row at zero
rows asks for rows through it
(Surface::request_size).
Sourcepub fn iter_mut(&mut self) -> impl Iterator<Item = (&str, &mut Surface<M>)>
pub fn iter_mut(&mut self) -> impl Iterator<Item = (&str, &mut Surface<M>)>
Every live instance, by pane.
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
Trait Implementations§
Auto Trait Implementations§
impl<M> !RefUnwindSafe for Instances<M>
impl<M> !Send for Instances<M>
impl<M> !Sync for Instances<M>
impl<M> !UnwindSafe for Instances<M>
impl<M> Freeze for Instances<M>
impl<M> Unpin for Instances<M>
impl<M> UnsafeUnpin for Instances<M>
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