Struct 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> Freeze for TagOpening<'a, 't, W>

§

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 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.

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.