rust_expect/multi/
mod.rs

1//! Multi-session management and selection.
2//!
3//! This module provides functionality for managing multiple terminal sessions
4//! simultaneously and performing operations across them, such as:
5//!
6//! - Waiting for any session to match a pattern (`expect_any`)
7//! - Waiting for all sessions to match patterns (`expect_all`)
8//! - Sending to multiple sessions in parallel
9//! - Per-session pattern selection
10//!
11//! # Example
12//!
13//! ```ignore
14//! use rust_expect::multi::MultiSessionManager;
15//!
16//! #[tokio::main]
17//! async fn main() -> Result<(), rust_expect::ExpectError> {
18//!     let mut manager = MultiSessionManager::new();
19//!
20//!     // Add sessions (assuming you have Session instances)
21//!     // let id1 = manager.add(session1, "server1");
22//!     // let id2 = manager.add(session2, "server2");
23//!
24//!     // Wait for any to match
25//!     // let result = manager.expect_any("prompt>").await?;
26//!
27//!     Ok(())
28//! }
29//! ```
30
31mod group;
32mod select;
33
34pub use group::{GroupBuilder, GroupManager, GroupResult, SessionGroup};
35/// Session identifier type for multi-session operations.
36/// This is distinct from `types::SessionId` which is a UUID-based identifier.
37pub use select::SessionId as MultiSessionId;
38pub use select::{MultiSessionManager, PatternSelector, ReadyType, SelectResult, SendResult};