Struct gotham_restful::Success
source · [−]pub struct Success<T>(_);
Expand description
This can be returned from a resource when there is no cause of an error. For example:
#[derive(Deserialize, Serialize)]
struct MyResponse {
message: String
}
#[rest_read_all(MyResource)]
fn read_all(_state: &mut State) -> Success<MyResponse> {
let res = MyResponse { message: "I'm always happy".to_string() };
res.into()
}
Trait Implementations
sourceimpl<T: ResponseBody> ResourceResult for Success<T>
impl<T: ResponseBody> ResourceResult for Success<T>
sourcefn into_response(self) -> Result<Response, SerdeJsonError>
fn into_response(self) -> Result<Response, SerdeJsonError>
Turn this into a response that can be returned to the browser. This api will likely change in the future. Read more
sourcefn accepted_types() -> Option<Vec<Mime>>
fn accepted_types() -> Option<Vec<Mime>>
Return a list of supported mime types.
fn schema() -> OpenapiSchema
fn default_status() -> StatusCode
Auto Trait Implementations
impl<T> RefUnwindSafe for Success<T> where
T: RefUnwindSafe,
impl<T> Send for Success<T> where
T: Send,
impl<T> Sync for Success<T> where
T: Sync,
impl<T> Unpin for Success<T> where
T: Unpin,
impl<T> UnwindSafe for Success<T> where
T: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more