Skip to main content

Dock

Struct Dock 

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

Panels docked left, right, bottom and as center tabs. Every panel holds a node, so grids and forms keep working wherever the user moves them.

Users resize the side areas with the pointer or, on the focused divider, with the arrow keys (Home and End jump to the limits); move between the tabs of an area with Left and Right; close the focused panel with Delete; and open the panel options (the area’s button, Shift+F10 or the context menu key) to move a panel to another area, close it or show a closed one. Tabs can also be dragged between areas. Add super::MenuList::panels to a menu bar to show and hide panels from there. The layout is saved per user and screen in the app’s view store (App::datagrid_views), or in the browser without one.

ⓘ
Dock::new("Workspace")
    .left("files", "Files", tree)
    .center("orders", "Orders", grid)
    .center("chart", "Chart", chart)
    .bottom("log", "Log", log_grid)
    .right("props", "Properties", inspector)

Implementations§

Source§

impl Dock

Source

pub fn new(label: impl Into<Text>) -> Self

A dock with an accessible name, such as “Workspace”.

Source

pub fn panel( self, area: DockArea, id: &'static str, title: impl Into<Text>, node: impl Into<Node>, ) -> Self

Adds a panel. id names it in saved layouts: keep it stable, lower case, unique in the dock.

Source

pub fn left( self, id: &'static str, title: impl Into<Text>, node: impl Into<Node>, ) -> Self

Source

pub fn right( self, id: &'static str, title: impl Into<Text>, node: impl Into<Node>, ) -> Self

Source

pub fn bottom( self, id: &'static str, title: impl Into<Text>, node: impl Into<Node>, ) -> Self

Source

pub fn center( self, id: &'static str, title: impl Into<Text>, node: impl Into<Node>, ) -> Self

Source

pub fn sizes(self, left: u8, right: u8, bottom: u8) -> Self

First sizes of the side areas in percent, each kept within DOCK_SIZE.

Source

pub fn panel_ids(&self) -> Vec<&'static str>

Ids of the panels, in order.

Trait Implementations§

Source§

impl Component for Dock

Source§

fn render(&self, out: &mut String, r: &Render<'_>)

Source§

fn schema(&self) -> Json

Schema used by MCP tools and test generation. Include a "type" key.
Source§

fn children(&self) -> &[Node]

Nodes held by a container. Child i of the node at path p has the path p.i.
Source§

fn grid(&self) -> Option<&dyn GridSource>

Source§

fn form(&self) -> Option<&dyn FormSource>

Source§

fn reveal(&self, _field: &str) -> Option<Revealed>

The raw value of a masked field this component shows, for an audited reveal. The server checks the unmask permission before sending it.
Source§

fn import(&self) -> Option<&dyn ImportSource>

CSV import, for components that import rows (see crate::Import).
Source§

fn eager_children(&self) -> &[Node]

Children rendered with the page. Others, such as closed lazy tabs, load when first shown.
Source§

fn source(&self, _key: &str) -> Option<&dyn DataSource>

Data the component fetches through an action, by key (a field name for lookups).
Source§

fn shortcuts(&self) -> Vec<&str>

Keyboard shortcuts of the component’s own links, as declared, for the clash checks of App::check and App::check_page.
Source§

impl From<Dock> for Node

Source§

fn from(c: Dock) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

§

impl !RefUnwindSafe for Dock

§

impl !UnwindSafe for Dock

§

impl Freeze for Dock

§

impl Send for Dock

§

impl Sync for Dock

§

impl Unpin for Dock

§

impl UnsafeUnpin for Dock

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<A, B, T> HttpServerConnExec<A, B> for T
where B: Body,

Source§

impl<T> Instrument for T

Source§

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

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

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

impl<T> WithSubscriber for T

Source§

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

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

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