Expand description
§inline-client
Stateful Rust client foundation for Inline.
This crate sits above inline-sdk. The SDK owns lower-level API, upload, and
realtime RPC helpers. inline-client is the long-term TDLib-style client layer:
auth/session lifecycle, realtime reconnect, update ordering, local cache, sync
cursors, pending transactions, idempotent sends, and committed client events.
The first public surface is intentionally small. It defines shared vocabulary for hosts such as agents, CLI, bots, servers, native app bindings, and bridge adapters:
- native peer, dialog, history, participant, message, and mutation records
- typed async
InlineClienthandle plus single-ownerClientRunner - bounded command and event queues
- backend and store boundaries
- in-memory backend/store for client tests and host adapter tests
- SQLite store for durable sessions, dialogs, and message history
- SDK-backed backend skeleton for production transport/store integration
- realtime connector boundary with SDK and fake connector implementations
- host-provided external IDs for idempotency
- Inline random IDs and transaction identity
- client status and redacted error categories
- committed client events
- lossless vs best-effort event classification
Design rules:
- keep
inline-protocol,inline-sdk, andinline-clientas separate layers - keep host-specific behavior out of the Rust client core
- expose a small facade over an internal async client actor
- use bounded command and event queues so overload becomes visible backpressure
- emit committed state events after durable update application
- classify realtime updates as lossless or best-effort before applying cache policy
- keep local storage pluggable so CLI, agents, desktop, and mobile clients can share the same sync model without sharing filesystem assumptions
- use the standard Rust
logfacade in library code and leave logger initialization to parent binaries - redact tokens, message bodies, captions, local paths, and auth-sensitive fields from public debug output
inline-client is still pre-1.0. The public API will grow toward a full
stateful Inline client. The runtime already routes connect, status, dialogs,
history, logout, auth code login, participants, text/media sends, edits,
deletes, reactions, read receipts, typing, member snapshots, and chat creation
through a backend trait. The SDK backend sends/verifies email/SMS codes,
persists sessions, opens DMs, creates threads/reply threads, and reads
dialogs/history/participants through a store trait; it can optionally perform a
realtime SDK handshake through a connector trait. Host-only protocol envelopes,
HTTP/WebSocket routes, process flags, and deployment behavior are owned by the
host adapter or app. SDK-backed text and media sends use Inline realtime/API
RPCs, persist transaction state, and record returned message rows when the
server includes them in the send result. Live inbound realtime sync is the next
production piece. The SQLite store is durable enough for beta restart/catch-up
work, but cache schema expansion for users, cursors, reactions, media, and
richer transaction retry/recovery is still expected.
Re-exports§
pub use backend::BackendError;pub use backend::BackendResult;pub use backend::ClientBackend;pub use backend::InMemoryBackend;pub use backend::OperationOutcome;pub use backend::SendTextOutcome;pub use realtime::FakeRealtimeAttempt;pub use realtime::FakeRealtimeConnector;pub use realtime::RealtimeConnectRequest;pub use realtime::RealtimeConnectionInfo;pub use realtime::RealtimeConnector;pub use realtime::SdkRealtimeConnector;pub use runtime::ClientCommandError;pub use runtime::ClientRequestError;pub use runtime::ClientRunner;pub use runtime::DEFAULT_COMMAND_QUEUE_CAPACITY;pub use runtime::DEFAULT_EVENT_QUEUE_CAPACITY;pub use runtime::InlineClient;pub use runtime::InlineClientBuilder;pub use runtime::InlineClientRuntime;pub use sdk_backend::SdkBackend;pub use sdk_backend::SdkBackendBuildError;pub use sdk_backend::SdkBackendBuilder;pub use store::ClientStore;pub use store::InMemoryStore;pub use store::SqliteStore;pub use store::StoreError;pub use store::StoreResult;pub use store::StoredSession;pub use store::StoredTransaction;pub use types::AuthContactKind;pub use types::AuthCredential;pub use types::AuthStartRequest;pub use types::AuthStartResult;pub use types::AuthToken;pub use types::AuthVerifyRequest;pub use types::AuthVerifyResult;pub use types::ChatCreateParticipant;pub use types::ChatParticipantRecord;pub use types::ChatParticipantsPage;pub use types::ChatParticipantsRequest;pub use types::ClientStatusSnapshot;pub use types::ConnectRequest;pub use types::CreateDmRequest;pub use types::CreateReplyThreadRequest;pub use types::CreateThreadRequest;pub use types::CreatedChat;pub use types::DeleteMessageRequest;pub use types::DialogRecord;pub use types::DialogsPage;pub use types::DialogsRequest;pub use types::EditMessageRequest;pub use types::HistoryPage;pub use types::HistoryRequest;pub use types::MediaKind;pub use types::MessageContent;pub use types::MessageMutation;pub use types::MessageRecord;pub use types::PeerRef;pub use types::ReactRequest;pub use types::ReadRequest;pub use types::SendTextRequest;pub use types::TypingRequest;pub use types::UploadHandle;pub use types::UploadRequest;pub use types::UserRecord;
Modules§
- backend
- Backend/store boundary for client runtime operations. Backend boundary for client runtime operations.
- prelude
- Convenient imports for common client consumers.
- realtime
- Realtime connector boundary. Realtime connector boundary.
- runtime
- Async client facade and runner skeleton. Async client facade and runner skeleton.
- sdk_
backend - SDK-backed backend implementation. SDK-backed backend skeleton.
- store
- Durable store boundary. Store boundary for durable client state.
- types
- Native Inline client request and record types. Native Inline client request and record types.
Structs§
- Client
Failure - Redacted failure value suitable for status endpoints and bridge errors.
- Client
Identity - Application identity sent with Inline HTTP and realtime requests.
- External
Id - Opaque host-provided ID used for idempotency and echo reconciliation.
- Inline
Id - Opaque Inline ID used by high-level client events.
- Random
Id - Deterministic random ID attached to an Inline mutation.
- Transaction
Event - Transaction event emitted after client state changes.
- Transaction
Id - Stable client transaction ID.
- Transaction
Identity - Identity data used to reconcile a mutation across host, client, and server.
Enums§
- Client
Error - Errors returned by public
inline-clienthelper types. - Client
Error Category - Stable error categories exposed to client hosts.
- Client
Event - Committed client event for apps, bridges, agents, and hosts.
- Client
Status - High-level connection/auth state for apps, bridges, and agents.
- Event
Reliability - Reliability class for events delivered to hosts.
- Transaction
State - State of a durable client transaction.
Constants§
- VERSION
- Published package version.