Skip to main content

dex_sdk/
lib.rs

1// Copyright (c) 2026 Super Durable, Inc.
2//
3// Licensed under the Sustainable Use License 1.0.
4// You may not use this file except in compliance with the License.
5// See the LICENSE file in the repository root.
6//
7// SPDX-License-Identifier: LicenseRef-Sustainable-Use-1.0
8
9//! Strongly typed Rust client and worker APIs for durable Dex Flows.
10//!
11//! Define [`Flow`] and [`Step`] implementations, register them with [`Registry`], host them with
12//! [`Worker`], and control executions with [`Client`]. The crate also exposes typed Attributes,
13//! Channels, waits, decisions, RPCs, lifecycle options, and structured errors.
14
15#![deny(missing_docs)]
16
17mod attribute;
18mod attribute_match;
19mod channel;
20mod client;
21mod client_options;
22mod context;
23mod credential;
24mod flow;
25mod flow_config;
26mod flow_info;
27mod flow_result;
28mod flow_timeout_handler_options;
29mod handler_error;
30mod persistence;
31mod pull_registration;
32mod registry;
33mod retry_policy;
34mod rpc;
35mod rpc_invoke_options;
36mod sdk_error;
37mod search_flows_options;
38mod server_protocol;
39mod start_flow_options;
40mod step;
41mod step_execution;
42mod step_options;
43mod stop_flow_options;
44mod stream;
45mod sub_flow;
46mod time_travel_options;
47mod timer;
48mod value;
49mod value_hydrator;
50mod value_mapper;
51mod wait;
52mod wait_options;
53mod worker;
54mod worker_dispatcher;
55mod worker_options;
56mod worker_output;
57mod worker_pull;
58
59pub use attribute::{
60    Attribute, AttributeIndex, AttributeLock, AttributeMap, AttributeMapInstance, AttributeMapLoad,
61};
62pub use attribute_match::AttributeMatch;
63pub use channel::{Channel, ChannelGuard, ChannelMap, ChannelMapLoad, ChannelMessage};
64pub use client::FlowServiceTlsOptions;
65pub use client::{AttributeRead, AttributeReads, Client};
66pub use client_options::ClientOptions;
67pub use context::{Context, RecoveryErrorInfo, StepAttemptProgress};
68#[cfg(feature = "api-key-credential")]
69pub use credential::{ApiKeyCredential, ApiKeyCredentialBuilder, ApiKeyCredentialError};
70pub use credential::{Credential, CredentialError, FileCredential};
71pub use dex_blob_cache::{BlobCache, BlobCacheConfig};
72pub use flow::{Flow, FlowTimeoutHandler};
73pub use flow_config::{ActiveStepSearchMode, FlowConfig};
74pub use flow_info::{FlowErrorType, FlowInfo, FlowStatus, SearchFlowEntry, SearchFlowsPage};
75pub use flow_result::{FlowResult, StepCompletion};
76pub use flow_timeout_handler_options::{FlowTimeoutHandlerFailure, FlowTimeoutHandlerOptions};
77pub use handler_error::{HandlerError, HandlerResult};
78pub use persistence::PersistenceSchema;
79pub use pull_registration::{
80    PullQueueRegistrationState, PullRegistrationError, PullRegistrationState,
81};
82pub use registry::Registry;
83pub use retry_policy::RetryPolicy;
84pub use rpc::{Rpc, RpcDefinition, RpcList, RpcResult};
85pub use rpc_invoke_options::RpcInvokeOptions;
86pub use sdk_error::{ErrorSubStatus, SdkError, SdkResult, ServiceError, WorkerError};
87pub use search_flows_options::SearchFlowsOptions;
88pub use start_flow_options::{FlowTimeoutPolicy, IdReusePolicy, StartFlowOptions};
89pub use step::{Step, StepDecision, StepList, StepMovement};
90pub use step_execution::StepExecutionId;
91pub use step_options::{StepDurability, StepOptions, WaitForFailurePolicy};
92pub use stop_flow_options::StopFlowOptions;
93pub use stream::{
94    BufferedTextStream, BufferedTextStreamOptions, Stream, StreamMessage, StreamMessagesPage,
95};
96pub use sub_flow::{SubFlow, SubFlowOptions, SubFlowReusePolicy};
97pub use time_travel_options::{TimeTravelOptions, TimeTravelStepMethod};
98pub use timer::{Timer, TimerId};
99pub use tonic::Code as GrpcCode;
100pub use value::Value;
101pub use wait::{Condition, ConditionCombination, Wait};
102pub use wait_options::{WaitForAttributeOptions, WaitForStepCompletionOptions};
103pub use worker::Worker;
104pub use worker_options::{PullWorkerOptions, WorkerOptions};
105
106pub(crate) use value::short_type_name;