Skip to main content

DockNode

Enum DockNode 

Source
pub enum DockNode<TabId, PanelId> {
    Split {
        direction: Direction,
        children: Vec<DockNode<TabId, PanelId>>,
    },
    Panel(DockPanel<TabId, PanelId>),
}
Expand description

A node in the docking tree, either a split or a tabbed panel.

Variants§

§

Split

Fields

§direction: Direction
§children: Vec<DockNode<TabId, PanelId>>
§

Panel(DockPanel<TabId, PanelId>)

Implementations§

Source§

impl<TabId, PanelId> DockNode<TabId, PanelId>
where TabId: Clone + PartialEq, PanelId: Copy + PartialEq,

Source

pub fn is_empty(&self) -> bool

Whether this node is empty.

Source

pub fn panel(&self, panel_id: &PanelId) -> Option<&DockPanel<TabId, PanelId>>

Find the panel with the given id.

Source

pub fn panel_mut( &mut self, panel_id: &PanelId, ) -> Option<&mut DockPanel<TabId, PanelId>>

Mutable version of DockNode::panel.

Source

pub fn find_tab(&self, tab_id: &TabId) -> Option<(PanelId, usize)>

Find tab_id under this node.

Source

pub fn remove_tab_except( &mut self, tab_id: &TabId, except_panel_id: Option<&PanelId>, ) -> bool

Remove tab_id from every panel except except_panel_id.

Source

pub fn split_panel( &mut self, panel_id: &PanelId, side: Side, new_panel: &DockPanel<TabId, PanelId>, ) -> bool

Turn the matching panel into a split that holds the old panel and a new one.

Source

pub fn close_empty_panels(&mut self)

Remove empty panels.

Trait Implementations§

Source§

impl<TabId: Clone, PanelId: Clone> Clone for DockNode<TabId, PanelId>

Source§

fn clone(&self) -> DockNode<TabId, PanelId>

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<TabId: Debug, PanelId: Debug> Debug for DockNode<TabId, PanelId>

Source§

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

Formats the value using the given formatter. Read more
Source§

impl<TabId: PartialEq, PanelId: PartialEq> PartialEq for DockNode<TabId, PanelId>

Source§

fn eq(&self, other: &DockNode<TabId, PanelId>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<TabId, PanelId> StructuralPartialEq for DockNode<TabId, PanelId>

Auto Trait Implementations§

§

impl<TabId, PanelId> Freeze for DockNode<TabId, PanelId>
where PanelId: Freeze, TabId: Freeze,

§

impl<TabId, PanelId> RefUnwindSafe for DockNode<TabId, PanelId>
where PanelId: RefUnwindSafe, TabId: RefUnwindSafe,

§

impl<TabId, PanelId> Send for DockNode<TabId, PanelId>
where PanelId: Send, TabId: Send,

§

impl<TabId, PanelId> Sync for DockNode<TabId, PanelId>
where PanelId: Sync, TabId: Sync,

§

impl<TabId, PanelId> Unpin for DockNode<TabId, PanelId>
where PanelId: Unpin, TabId: Unpin,

§

impl<TabId, PanelId> UnsafeUnpin for DockNode<TabId, PanelId>
where PanelId: UnsafeUnpin, TabId: UnsafeUnpin,

§

impl<TabId, PanelId> UnwindSafe for DockNode<TabId, PanelId>
where PanelId: UnwindSafe, TabId: UnwindSafe,

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
§

impl<T> ComponentProps for T
where T: Any + PartialEq,

§

fn changed(&self, other: &(dyn ComponentProps + 'static)) -> bool

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
§

impl<T> IntoReadable<T> for T
where T: 'static + PartialEq,

§

fn into_readable(self) -> Readable<T>

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

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more
Source§

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

Source§

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