Skip to main content

Ui

Struct Ui 

Source
pub struct Ui { /* private fields */ }
Expand description

A type erased Ui

Implementations§

Source§

impl Ui

Source

pub fn new_root(&self, file_path: Option<&Path>) -> RwArea

Initiates and returns a new “master” Area

This Area must not have any parents, and must be placed on a new window, that is, a plain region with nothing in it.

Source

pub fn new_dyn_spawned( &self, file_path: Option<&Path>, spawn_id: SpawnId, specs: DynSpawnSpecs, win: usize, ) -> RwArea

Initiates and returns a new “dynamic spawned” RwArea

This is one of three ways of spawning floating Widgets. Another is with RawArea::spawn, in which a Widget will be bolted on the edges of another. Another one is through RawUi::new_static_spawned.

Source

pub fn new_static_spawned( &self, file_path: Option<&Path>, spawn_id: SpawnId, specs: StaticSpawnSpecs, win: usize, ) -> RwArea

Initiates and returns a new “static spawned” RawArea

This is one of three ways of spawning floating Widgets. Another is with RawArea::spawn, in which a Widget will be bolted on the edges of another. Another one is through RawUi::new_dyn_spawned.

Source

pub fn switch_window(&self, win: usize)

Switches the currently active window

This will only happen to with window indices that are actual windows. If at some point, a window index comes up that is not actually a window, that’s a bug.

Source

pub fn flush_layout(&self)

Flush the layout

When this function is called, it means that Duat has finished adding or removing widgets, so the ui should calculate the layout.

Source

pub fn print(&self)

Prints the layout

Since printing runs all on the same thread, it is most efficient to call a printing function after all the widgets are done updating, I think.

Source

pub fn unload(&self)

Unloads the RawUi

Unlike RawUi::close, this will happen both when Duat reloads the configuratio and when it closes the app.

These will happen inside of the dynamically loaded config crate.

Source

pub fn remove_window(&self, win: usize)

Removes a window from the RawUi

This should keep the current active window consistent. That is, if the current window was ahead of the deleted one, it should be shifted back, so that the same window is still displayed.

Source

pub fn size(&self) -> Coord

The bottom right Coord on the screen

Since the top left coord is Coord { x: 0.0, y: 0.0 }, this is also the size of the window.

Trait Implementations§

Source§

impl Clone for Ui

Source§

fn clone(&self) -> Ui

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for Ui

Auto Trait Implementations§

§

impl Freeze for Ui

§

impl !RefUnwindSafe for Ui

§

impl Send for Ui

§

impl Sync for Ui

§

impl Unpin for Ui

§

impl UnsafeUnpin for Ui

§

impl !UnwindSafe for Ui

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> TryClone for T
where T: Clone,

Source§

fn try_clone(&self) -> Result<T, Error>

Clones self, possibly returning an error.
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.