Skip to main content

Crate telltale_choreography

Crate telltale_choreography 

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 ast::Choreography;
pub use ast::MessageType;
pub use ast::Protocol;
pub use ast::Role;
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::GrammarComposer;
pub use compiler::GrammarComposerBuilder;
pub use compiler::GrammarCompositionError;
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::SimpleChannel;
pub use effects::TelltaleEndpoint;
pub use effects::TelltaleHandler;
pub use extensions::CodegenContext;
pub use extensions::ExtensionRegistry;
pub use extensions::ExtensionValidationError;
pub use extensions::GrammarExtension;
pub use extensions::ParseContext;
pub use extensions::ParseError;
pub use extensions::ProjectionContext;
pub use extensions::ProtocolExtension;
pub use extensions::StatementParser;
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
Abstract Syntax Tree for choreographic protocols
compiler
Choreography compilation pipeline
effects
Effect handler system for choreographic programming
extensions
DSL Extension System for Telltale
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§

choreography
Procedural macro for defining choreographic protocols.
mutex_lock
Helper macro for acquiring a mutex lock.
read_lock
Helper macro for acquiring a read lock.
register_extension
Convenience macro for registering extensions
write_lock
Helper macro for acquiring a write lock.

Structs§

ChannelCapacity
Channel capacity (bits).
MessageLenBytes
On-wire message length in bytes.
MockClock
Mock clock for deterministic testing.
QueueCapacity
Queue capacity (entries).
SeededRng
Seeded RNG for reproducible randomness.

Enums§

CompilationError
Compilation errors that can occur during choreography processing

Traits§

Clock
Trait for monotonic time in protocol execution.
Rng
Trait for random number generation in protocol execution.
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