a3s-flow 1.1.0

Durable workflow engine and Rust SDK for A3S
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
use crate::error::{FlowError, Result};

/// Validate a run identity at every event-stream boundary.
pub(crate) fn validate_run_id(run_id: &str) -> Result<()> {
    if run_id.is_empty()
        || !run_id
            .chars()
            .all(|ch| ch.is_ascii_alphanumeric() || ch == '-' || ch == '_')
    {
        return Err(FlowError::InvalidRunId(run_id.to_string()));
    }
    Ok(())
}