crossflow_diagram_editor 0.0.6

Frontend for crossflow diagrams
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use axum::{
    http::StatusCode,
    response::{IntoResponse, Response},
};
use crossflow::Cancellation;

pub(super) struct WorkflowCancelledResponse<'a>(pub(super) &'a Cancellation);

impl<'a> IntoResponse for WorkflowCancelledResponse<'a> {
    fn into_response(self) -> Response {
        Response::builder()
            .status(StatusCode::UNPROCESSABLE_ENTITY)
            .body(format!("workflow cancelled: {}", self.0.cause))
            .map_or(StatusCode::INTERNAL_SERVER_ERROR.into_response(), |resp| {
                resp.into_response()
            })
    }
}