Expand description
Weirdnet service framework: one server, many apps.
A server exposes typed request/response Services and live Hub feeds. Apps (desktop,
terminal, mobile through a Rust bridge, MCP) connect over Weirdnet streams, present their
Credentials once per stream, and every request and subscription is checked by an
Authorize hook before it runs.
service: request/response sessions. A session is one stream: aHellowith the caller’s credentials, then any number of concurrent calls, each with an id, each authorized on its ownAccess(permission and resource), cancellable.feed: live topic streams. AHubkeeps each topic’s state and a sequence number; a subscriber gets a snapshot then deltas, resumes from aPositionafter a reconnect (or gets a fresh snapshot when the gap is too old), and a slow subscriber is coalesced or re-snapshotted instead of stalling the publisher.auth: theAuthorizehook,Caller,Access,Admittedand combinators. Therosterfeature addsRosterAuth(the user’s linked devices and their device-role grants); theaccessfeature addsMembershipAuth(owner-signed memberships andweirdnet-accessroles).ProtocolId: versioned protocol ids such as/myapp/api/2.- The
netfeature (default) serves all of this on aweirdnet-netnode (Server) and dials it (NetDialer,Client).
Everything below the net feature is transport-neutral: a Channel is any ordered,
reliable message channel, and memory_pair gives two connected ends for tests.
Messages are CBOR. The protocol notes describe the wire format, and the design notes explain the choices.
Re-exports§
pub use auth::Access;pub use auth::Admitted;pub use auth::AllOf;pub use auth::AllowAll;pub use auth::AnyOf;pub use auth::Authorize;pub use auth::Caller;pub use auth::Credentials;pub use channel::Channel;pub use channel::Dialer;pub use channel::FrameRx;pub use channel::FrameTx;pub use channel::memory_pair;pub use error::ServiceError;pub use feed::Change;pub use feed::Event;pub use feed::FeedOptions;pub use feed::Hub;pub use feed::HubOptions;pub use feed::Live;pub use feed::Overflow;pub use feed::Position;pub use feed::State;pub use feed::Subscription;pub use feed::Topic;pub use feed::Watcher;pub use feed::serve_feed;pub use protocol::ProtocolId;pub use protocol::WIRE;pub use service::Service;pub use service::Session;pub use service::SessionOptions;pub use service::serve_session;
Modules§
- access
- The
accessfeature: many people on one server, through owner-signed memberships andweirdnet-accessroles. - auth
- Who is calling, what they ask for, and the hook that decides.
- channel
- Message channels: the transport-neutral pipe sessions and feeds run over.
- codec
- CBOR bodies and length-prefixed framing for byte streams (a big-endian
u32length, then the message). - error
- Errors, as they travel on the wire.
- feed
- Live topic feeds: snapshot, then deltas, with resume and backpressure.
- net
- The
netfeature: serving and dialing overweirdnet-netstreams. - protocol
- Versioned protocol ids.
- roster
- The
rosterfeature: admit the user’s own linked devices (weirdnet-sync roster). - service
- Request/response services and sessions.
Structs§
- Client
- Opens sessions and subscriptions to servers through a
Dialer, presenting the sameCredentialson each. Cheap to clone.