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
sourceimpl 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
sourceimpl IntoResponse for NoContent
impl IntoResponse for NoContent
sourceimpl ResponseSchema for NoContent
impl ResponseSchema for NoContent
sourcefn schema(code: StatusCode) -> OpenapiSchema
fn schema(code: StatusCode) -> OpenapiSchema
Returns the schema of the ()
type.
sourcefn status_codes() -> Vec<StatusCode>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A>where
A: Allocator,
fn status_codes() -> Vec<StatusCode>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A>where
A: Allocator,
A: Allocator,
All status codes returned by this response. Returns
[StatusCode::OK]
by default.Auto Trait Implementations
impl RefUnwindSafe for NoContent
impl Send for NoContent
impl Sync for NoContent
impl Unpin for NoContent
impl UnwindSafe for NoContent
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<T> IntoSql for T
impl<T> IntoSql for T
sourcefn into_sql<T>(self) -> Self::Expressionwhere
Self: AsExpression<T> + Sized,
T: SqlType + TypedExpressionType,
fn into_sql<T>(self) -> Self::Expressionwhere
Self: AsExpression<T> + Sized,
T: SqlType + TypedExpressionType,
Convert
self
to an expression for Diesel’s query builder. Read moresourcefn as_sql<'a, T>(&'a self) -> <&'a Self as AsExpression<T>>::Expressionwhere
&'a Self: AsExpression<T>,
T: SqlType + TypedExpressionType,
fn as_sql<'a, T>(&'a self) -> <&'a Self as AsExpression<T>>::Expressionwhere
&'a Self: AsExpression<T>,
T: SqlType + TypedExpressionType,
Convert
&self
to an expression for Diesel’s query builder. Read more