Skip to main content

Module types

Module types 

Source
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§

CallbackId
A unique identifier for a callback operation.
ExecutionArn
The Amazon Resource Name identifying a durable execution.
OperationId
A unique identifier for an operation within a durable execution.
ValidationError
Error returned when newtype validation fails.