Struct write_html::TagOpening

source ·
pub struct TagOpening<'a, 't, W: Write> { /* private fields */ }
Expand description

Represents a tag that is being opened.

Implementations§

source§

impl<'a, 't, W: Write> TagOpening<'a, 't, W>

source

pub fn new( tag: &'t str, w: &'a mut W, compactability: Compactability ) -> Result<Self, Error>

Creates a new TagOpening that will write to w.

source

pub fn attr<'s>( &'s mut self, name: impl AttributeName, value: impl AttributeValue ) -> Result<&'s mut Self, Error>

Adds an attribute to the tag.

Arguments
  • name - The name of the attribute.
  • value - The value of the attribute.
source

pub fn with_attr( self, name: impl AttributeName, value: impl AttributeValue ) -> Result<Self, Error>

Adds an attribute to the tag.

See [attr] for more information.

source

pub fn with_attributes(self, attributes: impl Attributes) -> Result<Self, Error>

Adds multiple attributes to the tag.

source

pub fn inner_html(self) -> Result<InsideTagHtml<'a, 't, W>, Error>

Finishes the opening of the tag and returns a InsideTagHtml that can be used to write the contents of the tag.

Trait Implementations§

source§

impl<'a, 't, W: Write> Drop for TagOpening<'a, 't, W>

source§

fn drop(&mut self)

Executes the destructor for this type. Read more

Auto Trait Implementations§

§

impl<'a, 't, W> RefUnwindSafe for TagOpening<'a, 't, W>where W: RefUnwindSafe,

§

impl<'a, 't, W> Send for TagOpening<'a, 't, W>where W: Send,

§

impl<'a, 't, W> Sync for TagOpening<'a, 't, W>where W: Sync,

§

impl<'a, 't, W> Unpin for TagOpening<'a, 't, W>

§

impl<'a, 't, W> !UnwindSafe for TagOpening<'a, 't, W>

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere 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 Twhere 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, U> TryFrom<U> for Twhere U: Into<T>,

§

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 Twhere U: TryFrom<T>,

§

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.