Expand description
A runtime client for one Rostra identity.
Client is the supported entry point. Construct it with Client::builder:
omitting Database creates a temporary in-memory, light client. Supplying
a durable database creates a full client and enables replication and
projection tasks. Clients start read-only unless the builder receives a
RostraIdSecretKey or Client::unlock_active is called later.
Client-created transports default to relay-only mode so that creating a
client does not expose its host’s IP address. Call the builder’s
public_mode(true) only when direct IP connectivity is an intentional
privacy tradeoff. A caller that supplies iroh_endpoint owns that
endpoint’s transport and privacy policy. The request handler is enabled by
default in both storage modes; durable clients also start background
synchronization by default.
A client owns its background tasks. Clone the returned std::sync::Arc to
keep the runtime alive; dropping the final strong reference aborts those
tasks. ClientHandle is weak and does not extend the runtime’s lifetime.
There is no separate shutdown protocol.
Initialization, activation, peer connection, publication, and explicit
synchronization return typed errors from error or DbError. A
database failure in background ingestion is logged and stops the affected
worker; the client does not globally restart failed workers. Database access
remains available through Client::db for integrations that need Rostra’s
materialized views.
Re-exports§
pub use crate::id::CompactTicket;pub use crate::id::IdPublishedData;pub use crate::id::IdResolvedData;pub use crate::multiclient::MultiClient;pub use crate::multiclient::MultiClientError;pub use crate::multiclient::MultiClientResult;
Modules§
Structs§
- Client
- The networked runtime for one Rostra identity.
- Client
Handle - Weak handle to
Client - Client
Ref - A strong reference to
Client - Client
RefError - Database
- The authoritative event store and projection boundary for one local identity.
- External
Event Id - Full, external event id
- IdP2P
State - Per-identity P2P connection state for debugging.
- Node
P2PState - Per-node (Iroh endpoint) connection state for debugging.
- P2PState
- In-memory P2P state for all known identities.
- Rostra
Id - Rostra
IdSecret Key - Self
Followee - One active direct follow in a coherent current self-follow snapshot.
- Short
Event Id ShortEventIdis short (16B) because it is always used in a context of an existingid::RostraIdso even though client might potentially grind collisions (64-bits of resistance) it really gains them nothing.- Social
Post Materialization Cursor - Opaque durable position in one database lineage’s SocialPost materialization feed.
- Social
Post Materialization Page - One bounded snapshot page from the ordinary SocialPost materialization feed.
Enums§
- DbError
- Node
Source - How we learned about a node.
- Social
Post Materialization - Current high-level state of one logged ordinary SocialPost materialization.
Constants§
- SOCIAL_
POST_ MATERIALIZATION_ SCAN_ MAX - Maximum number of materialization rows resolved by one scan.