groupcache 0.3.0

groupcache is a distributed caching and cache-filling library, intended as a replacement for a pool of memcached nodes in many cases. It shards by key to select which peer is responsible for that key.
Documentation
use rmp_serde::decode::Error;
use std::sync::Arc;
use tonic::Status;

#[derive(thiserror::Error, Debug)]
#[error(transparent)]
pub struct GroupcacheError {
    #[from]
    error: InternalGroupcacheError,
}

#[derive(thiserror::Error, Debug, Clone)]
#[error(transparent)]
pub(crate) struct DedupedGroupcacheError(pub(crate) Arc<InternalGroupcacheError>);

#[derive(thiserror::Error, Debug)]
pub(crate) enum InternalGroupcacheError {
    #[error("Loading error: '{}'", .0)]
    LocalLoader(#[from] Box<dyn std::error::Error + Send + Sync + 'static>),

    #[error("Transport error: '{}'", .0.message())]
    Transport(#[from] Status),

    #[error(transparent)]
    Rmp(#[from] Error),

    #[error(transparent)]
    Deduped(#[from] DedupedGroupcacheError),

    #[error(transparent)]
    Connection(#[from] tonic::transport::Error),

    #[error("Connection errors: {0:?}")]
    ConnectionErrors(Vec<InternalGroupcacheError>),

    #[error(transparent)]
    Anyhow(#[from] anyhow::Error),
}