rust-api-kit 0.1.2

A type-safe API definition toolkit for Rust — define your API once and share it across client and server, with compile-time guarantees.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
use super::client::{Response, integration::log_error};

impl<T, E, U> From<anyhow::Error> for Response<T, E, U>
where
    U: From<anyhow::Error>,
{
    fn from(value: anyhow::Error) -> Self {
        log_error(format!("Unexpected error: {:?}", value));

        Response::UnexpectedError(value.into())
    }
}