mirror of
https://github.com/rwf2/Rocket.git
synced 2025-01-30 05:12:13 +00:00
Expose docstring for JSON Responder impl.
This commit is contained in:
parent
d8afb4c7fa
commit
6184d94619
@ -89,9 +89,9 @@ impl<T: Deserialize> FromData for JSON<T> {
|
||||
}
|
||||
}
|
||||
|
||||
// Serializes the wrapped value into JSON. Returns a response with Content-Type
|
||||
// JSON and a fixed-size body with the serialization. If serialization fails, an
|
||||
// `Err` of `Status::InternalServerError` is returned.
|
||||
/// Serializes the wrapped value into JSON. Returns a response with Content-Type
|
||||
/// JSON and a fixed-size body with the serialized value. If serialization
|
||||
/// fails, an `Err` of `Status::InternalServerError` is returned.
|
||||
impl<T: Serialize> Responder<'static> for JSON<T> {
|
||||
fn respond(self) -> response::Result<'static> {
|
||||
serde_json::to_string(&self.0).map(|string| {
|
||||
|
Loading…
Reference in New Issue
Block a user