pub struct PaneLayout { /* private fields */ }Expand description
A computed rectangle for a pane.
Combines a pane identifier with the rectangle allocated by a split layout.
§Example
use ratatui::layout::Rect;
use ratatui_toolkit::primitives::resizable_grid::ResizableGrid;
let grid = ResizableGrid::new(1);
let panes = grid.layout_panes(Rect::new(0, 0, 10, 5));
let _ = panes[0].pane_id();Implementations§
Source§impl PaneLayout
impl PaneLayout
Sourcepub fn area(&self) -> Rect
Available on crate feature resizable-grid only.
pub fn area(&self) -> Rect
resizable-grid only.Returns the rectangle allocated to this pane.
§Arguments
- None.
§Returns
The allocated Rect.
§Errors
- None.
§Panics
- Does not panic.
§Safety
- No safety requirements.
§Performance
- O(1).
§Example
use ratatui::layout::Rect;
use ratatui_toolkit::primitives::resizable_grid::ResizableGrid;
let grid = ResizableGrid::new(0);
let panes = grid.layout_panes(Rect::new(0, 0, 10, 5));
let _ = panes[0].area();Sourcepub fn pane_id(&self) -> u32
Available on crate feature resizable-grid only.
pub fn pane_id(&self) -> u32
resizable-grid only.Returns the identifier for this pane.
§Arguments
- None.
§Returns
The pane identifier.
§Errors
- None.
§Panics
- Does not panic.
§Safety
- No safety requirements.
§Performance
- O(1).
§Example
use ratatui::layout::Rect;
use ratatui_toolkit::primitives::resizable_grid::ResizableGrid;
let grid = ResizableGrid::new(0);
let panes = grid.layout_panes(Rect::new(0, 0, 10, 5));
let _ = panes[0].pane_id();Trait Implementations§
Source§impl Clone for PaneLayout
impl Clone for PaneLayout
Source§fn clone(&self) -> PaneLayout
fn clone(&self) -> PaneLayout
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for PaneLayout
impl Debug for PaneLayout
Source§impl PartialEq for PaneLayout
impl PartialEq for PaneLayout
impl Copy for PaneLayout
impl Eq for PaneLayout
impl StructuralPartialEq for PaneLayout
Auto Trait Implementations§
impl Freeze for PaneLayout
impl RefUnwindSafe for PaneLayout
impl Send for PaneLayout
impl Sync for PaneLayout
impl Unpin for PaneLayout
impl UnsafeUnpin for PaneLayout
impl UnwindSafe for PaneLayout
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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