Expand description
Core Telltale library for session-typed communication.
This crate provides session types (Send, Receive, Select, LocalChoice, Branch, End) and channel abstractions for safe multiparty communication.
§Modules
types- Core session type definitions (GlobalType, LocalTypeR, Label)channel- Channel abstractions for communication
§Feature Flags
§Core Features
| Feature | Description |
|---|---|
serialize | Enable serialization support for session types |
test-utils | Testing utilities (random generation, etc.) |
wasm | WebAssembly support |
§Theory Features
| Feature | Description |
|---|---|
theory | Session type algorithms (projection, merge, duality, etc.) |
theory-async-subtyping | POPL 2021 asynchronous subtyping algorithm |
theory-bounded | Bounded recursion strategies |
§Meta Features
| Feature | Description |
|---|---|
full | Enable all optional features |
Re-exports§
pub use futures;pub use serde;pub use telltale_types as types;
Modules§
- channel
- Channel abstractions for asynchronous communication.
- dsl
- Shared DSL builtin types used by the
tell!macro output. - prelude
- Prelude module for convenient imports.
Macros§
- tell
- Procedural macro for defining Telltale protocol specifications.
Structs§
- Branch
- A protocol state where this role receives one of several branch choices.
- Choreography
- A complete choreographic protocol specification
- Choreography
Role - A role (participant) in the choreography
- Compiled
Choreography - Parsed choreography plus projected locals for integration work.
- DslMessage
Type - Message type with optional payload
- End
- This structure represents a terminated protocol.
- Label
- A message label with its payload sort.
- Local
Choice - A protocol state where this role makes a local branch decision without sending a label to a peer.
- Protocol
Annotation Record - One ordered annotation record collected from the AST.
- Receive
- This structure represents a protocol which next action is to receive .
- Select
- A protocol state where this role selects one of several branches.
- Send
- This structure represents a protocol which next action is to send.
- State
- Wrapper holding a mutable reference to a
Roleduring protocol execution.
Enums§
- Annotation
Scope - Scope for one collected annotation record.
- Compile
Artifacts Error - Errors produced by the integration helpers.
- DslProtocol
- Protocol specification using choreographic constructs
- Global
Type - Global types describe protocols from the bird’s-eye view.
- Local
Type - Extended local session type for code generation.
- Local
TypeR - Core local type matching Lean’s
LocalTypeR. - Payload
Sort - Payload sort types for message payloads.
- Projection
Error - Errors that can occur during projection
- Receive
Error - Error that can occur during a session receive operation.
- Session
Error - Error that can occur during a session send operation.
Traits§
- Choice
- Maps a choice label to its continuation session type.
- Choices
- Trait for an enum of possible branch choices.
- From
State - Trait for session types that can be constructed from a state.
- Into
Session - Trait for types that can be converted into a session.
- Message
- This trait represents a message to be exchanged between two participants. The generic type L is the type of the label (i.e. the content of the message).
- Role
- A participant in a session-typed protocol.
- Route
- Provides a route to another role for communication.
- Sealable
- Trait for types that can be sealed to prevent further use
- Session
- Marker trait for session types in a protocol.
Functions§
- collect_
choreography_ annotation_ records - Collect every ordered annotation record from a choreography.
- collect_
protocol_ annotation_ records - Collect every ordered annotation record from a protocol tree.
- compile_
choreography - Parse, validate, and project a choreography from DSL source text.
- compile_
choreography_ ast - Validate and project an already-parsed choreography.
- parse_
choreography_ str - Parse a choreographic protocol from a string
- project
- Project a choreography to a local session type for a specific role
- session
- Run a session-typed protocol that cannot fail.
- try_
session - Runs a session that may fail, returning a result.
Type Aliases§
- Send
Error - Error type for send operations, specialized to the channel’s error type.
Attribute Macros§
- session
- Attribute macro for session type definitions.