api_bindium 0.4.0

Framework for api binding crates
Documentation
pub mod bytes;
#[cfg(feature = "image")]
pub mod image;
pub mod json;
pub mod text;

/// Parse a response object to a specific type.
///
/// # Examples
///
/// See [text::TextParser], [json::JsonParser]
pub trait Parser<R> {
    /// The output type of the parser
    type Output;
    /// The error type of the parser
    type Error;

    fn parse(&self, response: R) -> Result<Self::Output, Self::Error>;
}