Skip to main content

Crate telltale_runtime

Crate telltale_runtime 

Source
Expand description

Choreographic Programming for Telltale

This crate provides a choreographic programming layer on top of Telltale’s session types, enabling global protocol specification with automatic projection.

The choreographic approach allows you to write distributed protocols from a global viewpoint, with automatic generation of local session types for each participant. This includes an effect handler system that decouples protocol logic from transport implementation.

Re-exports§

pub use runtime::SystemClock;
pub use runtime::SystemRng;
pub use identifiers::Datacenter;
pub use identifiers::Endpoint as TopologyEndpoint;
pub use identifiers::Namespace;
pub use identifiers::Region;
pub use identifiers::RoleName;
pub use compiler::generate_effects_protocol;
pub use compiler::create_standard_extension_parser;
pub use compiler::format_choreography;
pub use compiler::format_choreography_str;
pub use compiler::format_choreography_with_config;
pub use compiler::ExtensionParseError;
pub use compiler::ExtensionParser;
pub use compiler::ExtensionParserBuilder;
pub use compiler::PrettyConfig;
pub use effects::middleware::Metrics;
pub use effects::middleware::Retry;
pub use effects::middleware::Trace;
pub use effects::NoOpHandler;
pub use effects::interpret;
pub use effects::ChoreoHandler;
pub use effects::ChoreoHandlerExt;
pub use effects::ChoreoResult;
pub use effects::ChoreographyError;
pub use effects::Effect;
pub use effects::Endpoint;
pub use effects::InterpretResult;
pub use effects::InterpreterState;
pub use effects::LabelId;
pub use effects::MessageTag;
pub use effects::Program;
pub use effects::ProgramBuilder;
pub use effects::ProgramMessage;
pub use effects::RoleId;
pub use effects::InMemoryHandler;
pub use effects::RecordedEvent;
pub use effects::RecordingHandler;
pub use effects::TelltaleEndpoint;
pub use effects::TelltaleHandler;
pub use effects::TelltaleSession;
pub use runtime::spawn;
pub use runtime::spawn;
pub use runtime::spawn_local;
pub use topology::parse_topology;
pub use topology::ByteMessage;
pub use topology::InMemoryChannelTransport;
pub use topology::Location;
pub use topology::ParsedTopology;
pub use topology::Topology;
pub use topology::TopologyBuilder;
pub use topology::TopologyConstraint;
pub use topology::TopologyError;
pub use topology::TopologyHandler;
pub use topology::TopologyHandlerBuilder;
pub use topology::TopologyLoadError;
pub use topology::TopologyMode;
pub use topology::TopologyParseError;
pub use topology::TopologyValidation;
pub use topology::Transport;
pub use topology::TransportError;
pub use topology::TransportFactory;
pub use topology::TransportMessage;
pub use topology::TransportResult;
pub use topology::TransportType;
pub use heap::ChannelState;
pub use heap::Direction;
pub use heap::Heap;
pub use heap::HeapCommitment;
pub use heap::HeapError;
pub use heap::MerkleProof;
pub use heap::MerkleTree;
pub use heap::Message as HeapMessage;
pub use heap::MessagePayload;
pub use heap::ProofStep;
pub use heap::Resource;
pub use heap::ResourceId;
pub use testing::AsyncClock;
pub use testing::BlockedOn;
pub use testing::Checkpoint;
pub use testing::InMemoryTransport;
pub use testing::NullObserver;
pub use testing::ProtocolEnvelope;
pub use testing::ProtocolObserver;
pub use testing::ProtocolStateMachine;
pub use testing::RecordingObserver;
pub use testing::SimulatedTransport;
pub use testing::StepInput;
pub use testing::StepOutput;

Modules§

ast
AST types for choreographic protocols.
compiler
Choreography compilation pipeline
effects
Effect handler system for choreographic programming
extensions
Protocol extension system.
heap
Heap Module
identifiers
Typed identifiers used across topology and runtime APIs.
runtime
Runtime support for choreographic protocol execution
testing
Testing utilities for choreographic protocols
topology
Topology
tracing
Tracing support for choreographic protocols

Macros§

mutex_lock
Helper macro for acquiring a mutex lock.
read_lock
Helper macro for acquiring a read lock.
tell
Procedural macro for defining Telltale protocol specifications.
write_lock
Helper macro for acquiring a write lock.

Structs§

ChannelCapacity
Channel capacity (bits).
Choreography
A complete choreographic protocol specification
CodegenContext
Context provided during code generation
ExtensionRegistry
Registry for managing DSL extensions with conflict resolution
GrammarComposer
Manages dynamic composition of Pest grammars with extensions
GrammarComposerBuilder
Builder pattern for constructing grammar composers with extensions
MessageLenBytes
On-wire message length in bytes.
MessageType
Message type with optional payload
MockClock
Mock clock for deterministic testing.
ParseContext
Context provided during statement parsing
ProjectionContext
Context provided during projection
QueueCapacity
Queue capacity (entries).
Role
A role (participant) in the choreography
SeededRng
Seeded RNG for reproducible randomness.

Enums§

CompilationError
Compilation errors that can occur during choreography processing
ExtensionValidationError
Validation errors for protocol extensions
GrammarCompositionError
Errors that can occur during grammar composition
ParseError
Errors that can occur during extension parsing
Protocol
Protocol specification using choreographic constructs

Traits§

Clock
Trait for monotonic time in protocol execution.
GrammarExtension
Trait for adding new grammar rules to the choreographic DSL
ProtocolExtension
Trait for custom protocol behaviors that can be projected and validated
Rng
Trait for random number generation in protocol execution.
StatementParser
Trait for parsing custom protocol statements
WallClock
Trait for wall-clock timestamps used in metadata.

Functions§

compile_choreography_with_extensions
Convenience function for compiling choreography with built-in extensions
parse_and_generate_with_extensions
Parse and generate choreography code with extension support
parse_choreography_with_extensions
Parse choreography with extension support