Expand description
Newtype wrappers for domain identifiers in the AWS Durable Execution SDK.
This module provides type-safe wrappers for string identifiers used throughout the SDK. These newtypes prevent accidental mixing of different ID types at compile time while maintaining full compatibility with string-based APIs.
§Example
use durable_execution_sdk::types::{OperationId, ExecutionArn, CallbackId};
// Create from String or &str (no validation)
let op_id = OperationId::from("op-123");
let op_id2: OperationId = "op-456".into();
// Create with validation
let op_id3 = OperationId::new("op-789").unwrap();
assert!(OperationId::new("").is_err()); // Empty strings rejected
// Use as string via Deref
assert!(op_id.starts_with("op-"));
// Use in HashMap (implements Hash, Eq)
use std::collections::HashMap;
let mut map: HashMap<OperationId, String> = HashMap::new();
map.insert(op_id, "value".to_string());Structs§
- Callback
Id - A unique identifier for a callback operation.
- Execution
Arn - The Amazon Resource Name identifying a durable execution.
- Operation
Id - A unique identifier for an operation within a durable execution.
- Validation
Error - Error returned when newtype validation fails.