Expand description
Multi-session management and selection.
This module provides functionality for managing multiple terminal sessions simultaneously and performing operations across them, such as:
- Waiting for any session to match a pattern (
expect_any) - Waiting for all sessions to match patterns (
expect_all) - Sending to multiple sessions in parallel
- Per-session pattern selection
§Example
ⓘ
use rust_expect::multi::MultiSessionManager;
#[tokio::main]
async fn main() -> Result<(), rust_expect::ExpectError> {
let mut manager = MultiSessionManager::new();
// Add sessions (assuming you have Session instances)
// let id1 = manager.add(session1, "server1");
// let id2 = manager.add(session2, "server2");
// Wait for any to match
// let result = manager.expect_any("prompt>").await?;
Ok(())
}Structs§
- Group
Builder - Builder for session groups.
- Group
Manager - Manager for multiple session groups.
- Group
Result - Result of a group operation.
- Multi
Session Manager - Manager for multiple async sessions with select capabilities.
- Pattern
Selector - Builder for creating pattern selectors with per-session patterns.
- Select
Result - Result of a multi-session select operation.
- Send
Result - Result of a multi-session send operation.
- Session
Group - A group of sessions for parallel operations.
Enums§
- Ready
Type - Type of readiness event.
Type Aliases§
- Multi
Session Id - Session identifier type for multi-session operations.
This is distinct from
types::SessionIdwhich is a UUID-based identifier. Unique identifier for a session within a multi-session manager.