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>
impl<'a, 't, W: Write> TagOpening<'a, 't, W>
Sourcepub fn new(
tag: &'t str,
w: &'a mut W,
compactability: Compactability,
) -> Result<Self, Error>
pub fn new( tag: &'t str, w: &'a mut W, compactability: Compactability, ) -> Result<Self, Error>
Creates a new TagOpening
that will write to w
.
Sourcepub fn attr<'s>(
&'s mut self,
name: impl AttributeName,
value: impl AttributeValue,
) -> Result<&'s mut Self, Error>
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.
Sourcepub fn with_attr(
self,
name: impl AttributeName,
value: impl AttributeValue,
) -> Result<Self, Error>
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.
Sourcepub fn with_attributes(self, attributes: impl Attributes) -> Result<Self, Error>
pub fn with_attributes(self, attributes: impl Attributes) -> Result<Self, Error>
Adds multiple attributes to the tag.
Sourcepub fn inner_html(self) -> Result<InsideTagHtml<'a, 't, W>, Error>
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§
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> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more