Skip to main content

reply_with_status

Function reply_with_status 

Source
pub fn reply_with_status(
    status: Status,
    reply: impl Reply,
) -> Result<impl Reply, Rejection>
Expand description

Wraps reply with the given HTTP status code and returns it as a warp result.

Use when an endpoint needs to respond with a specific status alongside a plain message. Pairs with the [reply!] macro form reply!(message => ..., status => ...).