Skip to main content

StandardBidirChannel

Type Alias StandardBidirChannel 

Source
pub type StandardBidirChannel = BidirChannel<StandardRequest, StandardResponse>;
Expand description

Type alias for standard interactive UI patterns.

StandardBidirChannel provides convenient methods for common interactions:

§Example

use plexus_core::plexus::bidirectional::{StandardBidirChannel, SelectOption};

async fn wizard(ctx: &StandardBidirChannel) {
    // Step 1: Get name
    let name = ctx.prompt("Enter project name:").await?;

    // Step 2: Select template
    let templates = vec![
        SelectOption::new("minimal", "Minimal"),
        SelectOption::new("full", "Full Featured"),
    ];
    let template = ctx.select("Choose template:", templates).await?;

    // Step 3: Confirm creation
    if ctx.confirm(&format!("Create '{}' with {} template?", name, template[0])).await? {
        // Create project
    }
}

§Transport Requirements

The underlying transport must support bidirectional communication. If not, all methods return Err(BidirError::NotSupported).

Aliased Type§

pub struct StandardBidirChannel { /* private fields */ }