crate-index 0.1.0

A small library for managing a Cargo crate index
Documentation
use crate::validate;
use std::io;

/// This [`Error`] represents anything that can go wrong with this library
#[derive(Debug, thiserror::Error)]
pub enum Error {
    /// Metadata validation error
    #[error("Validation Error")]
    Validation(#[from] validate::Error),

    /// filesystem IO error
    #[error("IO Error")]
    Io(#[from] io::Error),

    /// libgit2 error
    #[error("Git Error")]
    Git(#[from] git2::Error),

    /// requested crate data not found
    #[error("Not Found Error")]
    NotFound,
}

/// The result type for fallible functions in this library
pub type Result<T> = std::result::Result<T, Error>;