another_html_builder

Struct Buffer

Source
pub struct Buffer<W, C> { /* private fields */ }

Implementations§

Source§

impl Buffer<String, Body<'static>>

Source

pub fn new() -> Self

Source§

impl<W> Buffer<W, Body<'_>>

Source

pub fn into_inner(self) -> W

Source§

impl Buffer<String, Body<'_>>

Source

pub fn inner(&self) -> &str

Source§

impl<W: Write> Buffer<W, Body<'_>>

Source

pub fn doctype(self) -> Self

Source

pub fn try_doctype(self) -> Result<Self, Error>

Source§

impl<'a, W: Write> Buffer<W, Body<'a>>

Source

pub fn node(self, tag: &'a str) -> Buffer<W, Element<'a>>

Source

pub fn try_node(self, tag: &'a str) -> Result<Buffer<W, Element<'a>>, Error>

Source

pub fn raw<V: Display>(self, value: V) -> Self

Source

pub fn try_raw<V: Display>(self, value: V) -> Result<Self, Error>

Source

pub fn text(self, content: &str) -> Self

Source

pub fn try_text(self, content: &str) -> Result<Self, Error>

Source§

impl<'a, W: Write> Buffer<W, Element<'a>>

Source

pub fn attr<T>(self, attr: T) -> Self
where Attribute<T>: Display,

Source

pub fn try_attr<T>(self, attr: T) -> Result<Self, Error>
where Attribute<T>: Display,

Source

pub fn close(self) -> Buffer<W, Body<'a>>

Source

pub fn try_close(self) -> Result<Buffer<W, Body<'a>>, Error>

Source

pub fn content<F>(self, children: F) -> Buffer<W, Body<'a>>
where F: FnOnce(Buffer<W, Body<'_>>) -> Buffer<W, Body<'_>>,

Source

pub fn try_content<F>(self, children: F) -> Result<Buffer<W, Body<'a>>, Error>
where F: FnOnce(Buffer<W, Body<'_>>) -> Result<Buffer<W, Body<'_>>, Error>,

Trait Implementations§

Source§

impl<W: Clone, C: Clone> Clone for Buffer<W, C>

Source§

fn clone(&self) -> Buffer<W, C>

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<W: Debug, C: Debug> Debug for Buffer<W, C>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for Buffer<String, Body<'static>>

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

§

impl<W, C> Freeze for Buffer<W, C>
where W: Freeze, C: Freeze,

§

impl<W, C> RefUnwindSafe for Buffer<W, C>

§

impl<W, C> Send for Buffer<W, C>
where W: Send, C: Send,

§

impl<W, C> Sync for Buffer<W, C>
where W: Sync, C: Sync,

§

impl<W, C> Unpin for Buffer<W, C>
where W: Unpin, C: Unpin,

§

impl<W, C> UnwindSafe for Buffer<W, C>
where W: UnwindSafe, C: UnwindSafe,

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. 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.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.