Skip to main content

HtmlContent

Struct HtmlContent 

Source
pub struct HtmlContent(pub &'static str);

Tuple Fields§

§0: &'static str

Trait Implementations§

Source§

impl Content for HtmlContent

Source§

fn content_type(&self) -> &'static str

Implements content type.

Source§

fn content_length(&self) -> usize

Implements content length.

Source§

async fn write_content<W: Write>(self, writer: W) -> Result<(), W::Error>

Write the content data.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

§

impl<C> IntoResponse for C
where C: Content,

§

async fn write_to<R, W>( self, connection: Connection<'_, R>, response_writer: W, ) -> Result<ResponseSent, <W as ResponseWriter>::Error>
where R: Read, W: ResponseWriter<Error = <R as ErrorType>::Error>,

Write the generated response into the given [ResponseWriter].
§

impl<T, State> IntoResponseWithState<State> for T
where T: IntoResponse,

§

async fn write_to_with_state<R, W>( self, _state: &State, connection: Connection<'_, R>, response_writer: W, ) -> Result<ResponseSent, <W as ResponseWriter>::Error>
where R: Read, W: ResponseWriter<Error = <R as ErrorType>::Error>,

Write the generated response into the given [ResponseWriter].
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<State, T> WithStateUpdate<State> for T
where T: IntoResponseWithState<State>,

§

fn with_state_update<F>( self, state_update: F, ) -> IntoResponseWithStateUpdate<State, Self, F>
where F: AsyncFnOnce(&State),