SessionGroup

Struct SessionGroup 

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

A group of sessions for parallel operations.

Implementations§

Source§

impl SessionGroup

Source

pub fn new(name: impl Into<String>) -> Self

Create a new session group.

Source

pub const fn with_timeout(self, timeout: Duration) -> Self

Set timeout for group operations.

Source

pub fn name(&self) -> &str

Get group name.

Source

pub fn add(&mut self, label: impl Into<String>) -> usize

Add a session to the group.

Source

pub fn remove(&mut self, id: usize)

Remove a session from the group.

Source

pub fn len(&self) -> usize

Get session count.

Source

pub fn is_empty(&self) -> bool

Check if empty.

Source

pub fn active_count(&self) -> usize

Get active session count.

Source

pub fn label(&self, id: usize) -> Option<&str>

Get session label.

Source

pub fn set_active(&mut self, id: usize, active: bool)

Set session active state.

Source

pub fn append_output(&mut self, id: usize, output: &str)

Append output for a session.

Source

pub fn output(&self, id: usize) -> Option<&str>

Get output for a session.

Source

pub fn clear_output(&mut self)

Clear output for all sessions.

Source

pub fn session_ids(&self) -> Vec<usize>

Get all session IDs.

Source

pub fn active_ids(&self) -> Vec<usize>

Get active session IDs.

Source

pub fn for_each<F>(&self, f: F)
where F: FnMut(usize, &str),

Execute an operation on all active sessions.

Trait Implementations§

Source§

impl Debug for SessionGroup

Source§

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

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

impl Default for SessionGroup

Source§

fn default() -> SessionGroup

Returns the “default value” for a type. 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.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V