Skip to main content

Session

Struct Session 

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

Opaque handle for one live daemon session.

The handle stores the daemon transport and exact protocol-owned session name. It never stores process environment supplied while creating the session.

Implementations§

Source§

impl Session

Source

pub fn name(&self) -> &SessionName

Returns the exact protocol-owned session name addressed by this handle.

Source

pub fn endpoint(&self) -> &RmuxEndpoint

Returns the endpoint that was resolved when this handle was created.

Source

pub const fn configured_default_timeout(&self) -> Option<Duration>

Returns the default timeout configured on the parent facade.

Source

pub const fn was_created(&self) -> bool

Returns whether the ensure operation created the session.

false means the handle was bound to a session that already existed before the ensure request completed.

Source

pub fn creation_tags(&self) -> Option<&[String]>

Returns caller-supplied creation tag intent, preserving explicit empty tag sets.

Source

pub async fn exists(&self) -> Result<bool>

Checks the live daemon for this session.

Source

pub async fn is_listed(&self) -> Result<bool>

Checks whether this session appears in the daemon’s list-sessions projection.

Source

pub async fn list_session_names(&self) -> Result<Vec<SessionName>>

Lists exact session names currently reported by the daemon.

Source

pub fn window(&self, window_index: u32) -> Window

Returns a handle for a window slot in this session.

The handle is intentionally lazy: it records the exact target and verifies liveness only when an operation such as split, panes, info, or close is invoked. Linked windows and grouped sessions are still resolved by the daemon on each operation rather than cached by the handle.

Source

pub fn pane(&self, window_index: u32, pane_index: u32) -> Pane

Returns a handle for one pane slot inside a window of this session.

The handle records the exact (session, window, pane) triple and resolves it through the daemon on every operation, so linked windows and grouped sessions keep returning the same stable pane identity across sibling views.

Source

pub async fn pane_by_id(&self, pane_id: PaneId) -> Result<Pane>

Returns a pane handle addressed by stable pane id.

The returned Pane has the same public type as a slot-based pane, but input, resize, lifecycle, title, and snapshot operations use the daemon’s stable pane-id targeting path. PaneId is stable only for one daemon lifetime; callers that persist ids across reconnects must re-validate them.

Source

pub async fn new_window(&self) -> Result<Window>

Creates a new window in this session and returns a live window handle.

This is an eager daemon mutation. Use Self::window when you only need a lazy handle for an existing or future window slot.

Source

pub fn new_window_with(&self) -> NewWindowBuilder<'_>

Starts building a configurable new-window request for this session.

The default builder behavior matches tmux new-window: the created window becomes active unless NewWindowBuilder::detached is set.

Source

pub fn layout(&self) -> SessionLayoutBuilder<'_>

Starts a declarative SDK layout builder for this session.

Layouts are SDK-side composition over the existing pane split, spawn, title, and daemon spread-layout primitives. They do not add a daemon-native transaction; if an intermediate split or spawn fails, already-created panes remain visible for inspection and cleanup by the caller.

Source

pub async fn kill(&self) -> Result<bool>

Destroys this session through the daemon.

The returned boolean mirrors the daemon response: true means a session existed and was removed.

Source§

impl Session

Source

pub fn share(&self) -> WebShareBuilder<'_>

Starts a web-share builder for this session.

Trait Implementations§

Source§

impl Debug for Session

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

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<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 = 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.