Struct gotham_restful::NoContent
source · pub struct NoContent { /* private fields */ }
Expand description
This is the return type of a resource that doesn’t actually return something. It will result in a 204 No Content answer by default. You don’t need to use this type directly if using the function attributes:
#[read_all]
fn read_all() {
// do something
}
Implementations§
source§impl NoContent
impl NoContent
sourcepub fn header<K: IntoHeaderName>(&mut self, name: K, value: HeaderValue)
pub fn header<K: IntoHeaderName>(&mut self, name: K, value: HeaderValue)
Set a custom HTTP header. If a header with this name was set before, its value is being updated.
sourcepub fn headers_mut(&mut self) -> &mut HeaderMap
pub fn headers_mut(&mut self) -> &mut HeaderMap
Allow manipulating HTTP headers.
Trait Implementations§
source§impl IntoResponse for NoContent
impl IntoResponse for NoContent
source§impl ResponseSchema for NoContent
impl ResponseSchema for NoContent
source§fn schema(code: StatusCode) -> OpenapiSchema
fn schema(code: StatusCode) -> OpenapiSchema
Returns the schema of the ()
type.
source§fn status_codes() -> Vec<StatusCode>
fn status_codes() -> Vec<StatusCode>
All status codes returned by this response. Returns
[StatusCode::OK]
by default.Auto Trait Implementations§
impl Freeze for NoContent
impl RefUnwindSafe for NoContent
impl Send for NoContent
impl Sync for NoContent
impl Unpin for NoContent
impl UnwindSafe for NoContent
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§impl<T> IntoSql for T
impl<T> IntoSql for T
source§fn into_sql<T>(self) -> Self::Expression
fn into_sql<T>(self) -> Self::Expression
Convert
self
to an expression for Diesel’s query builder. Read moresource§fn as_sql<'a, T>(&'a self) -> <&'a Self as AsExpression<T>>::Expression
fn as_sql<'a, T>(&'a self) -> <&'a Self as AsExpression<T>>::Expression
Convert
&self
to an expression for Diesel’s query builder. Read more