pub enum Surface<Tab> {
    Empty,
    Main(Tree<Tab>),
    Window(Tree<Tab>, WindowState),
}
Expand description

A Surface is the highest level component in a DockState. Surfaces represent an area in which nodes are placed. Typically, you’re only using one surface, which is the main surface. However, if you drag a tab out in a way which creates a window, you also create a new surface in which nodes can appear.

Variants§

§

Empty

An empty surface, with nothing inside (practically, a null surface).

§

Main(Tree<Tab>)

The main surface of a DockState, only one should exist at surface index 0 at any one time.

§

Window(Tree<Tab>, WindowState)

A windowed surface with a state.

Implementations§

source§

impl<Tab> Surface<Tab>

source

pub const fn is_empty(&self) -> bool

Is this surface Empty (in practice null)?

source

pub fn node_tree_mut(&mut self) -> Option<&mut Tree<Tab>>

Get mutable access to the node tree of this surface.

source

pub fn node_tree(&self) -> Option<&Tree<Tab>>

Get access to the node tree of this surface.

Trait Implementations§

source§

impl<Tab: Clone> Clone for Surface<Tab>

source§

fn clone(&self) -> Surface<Tab>

Returns a copy 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<Tab: Debug> Debug for Surface<Tab>

source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<Tab> RefUnwindSafe for Surface<Tab>where Tab: RefUnwindSafe,

§

impl<Tab> Send for Surface<Tab>where Tab: Send,

§

impl<Tab> Sync for Surface<Tab>where Tab: Sync,

§

impl<Tab> Unpin for Surface<Tab>where Tab: Unpin,

§

impl<Tab> UnwindSafe for Surface<Tab>where Tab: UnwindSafe,

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere 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 Twhere 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 Twhere T: Clone,

§

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

§

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 Twhere U: TryFrom<T>,

§

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.
source§

impl<T> SerializableAny for Twhere T: 'static + Any + Clone + for<'a> Send + Sync,