weirdnet-contacts 0.1.0

A contact book for Weirdnet apps: trusted and blocked identities, presence with privacy rules (base to everyone, detail to trusted contacts), signed text direct messages with delivery state and an offline queue, and contact links, served over weirdnet-service.
Documentation
//! A contact book for Weirdnet apps.
//!
//! - [`Book`]: who you know, as [`ContactState::Trusted`], [`ContactState::Blocked`] or not at
//!   all, a ban list keyed by identity, and your [`PresencePolicy`].
//! - Presence with privacy rules ([`presence`]): everyone online sees your base state (online,
//!   away or busy), and only trusted contacts see the detail fields (status line, in-session
//!   hint, last seen) that your policy allows. [`presence::view_for`] decides, in one place.
//! - Signed text direct messages and invite cards ([`message`]) with a delivery state, an
//!   offline queue and conversations that merge, so two nodes (or your own devices) converge
//!   after they were apart.
//! - [`ContactLink`]: a `weirdnet-contact:` link or QR payload that adds someone.
//! - [`Contacts`]: the live state behind one `Mutex`, [`service::ContactsService`] to serve it
//!   over [`weirdnet_service`], and [`client`] to send, flush, pull and read presence.
//!
//! An identity here is the transport peer id ([`UserId`]): the service authorizes a caller by
//! the peer the connection proved, and a message must come from the peer that signed it. The
//! crate is app-neutral and keeps nothing on disk: [`Contacts::snapshot`] and
//! [`Contacts::restore`] give the app plain serde data to store as it likes.
//!
//! The relay never carries messages or detail presence; those go node to node. Finding who is
//! online is the job of `weirdnet-presence`.
#![forbid(unsafe_code)]

pub mod book;
pub mod client;
pub mod contacts;
pub mod id;
pub mod link;
pub mod message;
pub mod presence;
pub mod service;

pub use book::{Book, Contact, ContactState};
pub use contacts::{Contacts, Receipt, Refusal, Snapshot};
pub use id::{IdError, UserId};
pub use link::ContactLink;
pub use message::{Body, Conversation, Delivery, DirectInvite, Entry, Message, MessageId};
pub use presence::{Audience, Detail, InSession, Presence, PresenceInfo, PresencePolicy, PresenceView, SessionHint, Viewer};