Skip to main content

Instances

Struct Instances 

Source
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>

Source

pub fn new(surface: &str) -> Self

The instances of the manifest’s surface surface.

Source

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.

Source

pub fn get_mut(&mut self, pane: &str) -> Option<&mut Surface<M>>

Source

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).

Source

pub fn iter_mut(&mut self) -> impl Iterator<Item = (&str, &mut Surface<M>)>

Every live instance, by pane.

Source

pub fn len(&self) -> usize

Source

pub fn is_empty(&self) -> bool

Trait Implementations§

Source§

impl<M: Debug + SurfaceModel> Debug for Instances<M>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Resource for T
where T: 'static,

Source§

type Rep = Option<T>

The type which is actually stored in-memory for this resource. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.