duat_core::ui

Struct Window

Source
pub struct Window<U>
where U: Ui,
{ /* private fields */ }
Expand description

A container for a master Area in Parsec

Implementations§

Source§

impl<U> Window<U>
where U: Ui + 'static,

Source

pub fn new<W: Widget<U>>( ui: &mut U, widget: W, checker: impl Fn() -> bool + Send + Sync + 'static, layout: Box<dyn Layout<U>>, ) -> (Self, Node<U>)

Returns a new instance of Window<U>

Source

pub fn push<W: Widget<U>>( &mut self, widget: W, area: &U::Area, checker: impl Fn() -> bool + 'static, specs: PushSpecs, cluster: bool, ) -> (Node<U>, Option<U::Area>)

Pushes a Widget onto an existing one

Source

pub fn push_file( &mut self, file: File, checker: impl Fn() -> bool + 'static, ) -> Result<(Node<U>, Option<U::Area>), ()>

Pushes a File to the file’s parent

This function will push to the edge of self.files_parent This is an area, usually in the center, that contains all Files, and their associated Widgets, with others being at the perifery of this area.

Source

pub fn nodes(&self) -> impl DoubleEndedIterator<Item = &Node<U>>

Source

pub fn file_names(&self) -> impl Iterator<Item = (usize, String)> + Clone + '_

Returns an Iterator over the names of Files and their respective Widget indices.

Source

pub fn len_widgets(&self) -> usize

Auto Trait Implementations§

§

impl<U> Freeze for Window<U>
where <U as Ui>::Area: Freeze,

§

impl<U> !RefUnwindSafe for Window<U>

§

impl<U> Send for Window<U>

§

impl<U> Sync for Window<U>

§

impl<U> Unpin for Window<U>
where <U as Ui>::Area: Unpin,

§

impl<U> !UnwindSafe for Window<U>

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, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.