weirdnet-sync 0.8.2

Weirdnet sync: hybrid logical clocks, an op log, LWW and OR-set merge, tombstone GC, SyncKey page sealing, a device roster with self-cert, revocation, key rotation with re-admission, user-signed device grants and service devices linked without the seed, majority-vote leases with fencing terms, signed plans and a job log, and the /weirdnet/sync/2 pull protocol over weirdnet-net.
Documentation
use thiserror::Error;

#[derive(Debug, Error)]
#[non_exhaustive]
pub enum SyncError {
    #[error("{0}")]
    Crypto(String),
    #[error("refused: {0}")]
    Refused(String),
    #[error("codec: {0}")]
    Codec(String),
    #[error("{0}")]
    Protocol(String),
    /// Reading or writing an [`crate::identity::Identity`]'s files.
    #[error("{0}")]
    Io(String),
    /// An [`crate::identity::Identity`] that can't be created, adopted or opened as asked.
    #[error("{0}")]
    Identity(String),
    /// Something only a device holding the identity seed may do (admit, revoke, grant,
    /// rotate), asked of a service device linked without it.
    #[error("not permitted on a service device: {0}")]
    NotPermitted(String),
}

impl From<weirdnet_keys::KeysError> for SyncError {
    fn from(e: weirdnet_keys::KeysError) -> Self {
        SyncError::Crypto(e.to_string())
    }
}

impl From<weirdnet_net::NetError> for SyncError {
    fn from(e: weirdnet_net::NetError) -> Self {
        SyncError::Crypto(e.to_string())
    }
}

pub type Result<T> = std::result::Result<T, SyncError>;