pub enum PaneSize {
Cells(u32),
Percent(u32),
}Expand description
How much space a new pane gets.
§Examples
use libtmux::{PaneSize, SplitDirection, SplitOptions};
// A size renders as tmux's own `-l` argument, cells bare and shares suffixed.
assert_eq!(PaneSize::Cells(20).to_string(), "20");
assert_eq!(PaneSize::Percent(25).to_string(), "25%");
let guard = libtmux::test::TestServer::new().await?;
let session = guard.server().new_session("work").await?;
let window = session.active_window().await?.expect("a session has a window");
let pane = window
.split(SplitOptions::new(SplitDirection::Below).size(PaneSize::Percent(25)))
.await?;
assert!(pane.height() > 0);
guard.shutdown().await?;Variants§
Cells(u32)
A number of rows or columns, depending on the split direction.
Percent(u32)
A share of the space being divided, as a percentage.
Trait Implementations§
impl Copy for PaneSize
impl Eq for PaneSize
impl StructuralPartialEq for PaneSize
Auto Trait Implementations§
impl Freeze for PaneSize
impl RefUnwindSafe for PaneSize
impl Send for PaneSize
impl Sync for PaneSize
impl Unpin for PaneSize
impl UnsafeUnpin for PaneSize
impl UnwindSafe for PaneSize
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