Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(responder): expose Responder::respond() method send response wit… #105

Merged
merged 1 commit into from
Dec 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "medullah-web"
version = "0.23.3"
version = "0.23.4"
edition = "2021"
license = "MIT"
description = "Micro-Framework Based on Ntex"
Expand Down
11 changes: 10 additions & 1 deletion src/helpers/responder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,16 @@ impl Responder {
Self::respond(message, status)
}

fn respond<T: Serialize>(data: T, status: StatusCode) -> Response {
/// Send a response without the standard response wrapper
///
/// # Arguments
///
/// * `data`: Any item that implements serde::Serialize
/// * `status`: A http status code to respond with
///
/// returns: Response<Body>
///
pub fn respond<T: Serialize>(data: T, status: StatusCode) -> Response {
Self::make_response(data, status)
}

Expand Down
Loading