pub struct El { /* private fields */ }Expand description
An element under construction. Every builder method takes and returns self, so a
page reads as one expression.
Implementations§
Source§impl El
impl El
Sourcepub fn attr(self, name: &str, value: impl Into<String>) -> Self
pub fn attr(self, name: &str, value: impl Into<String>) -> Self
Set an attribute. A later set of the same name replaces the earlier one, so a helper can set a default that a caller overrides.
Sourcepub fn attr_if(self, name: &str, value: Option<impl Into<String>>) -> Self
pub fn attr_if(self, name: &str, value: Option<impl Into<String>>) -> Self
Set an attribute only when there is a value.
Sourcepub fn flag(self, name: &str) -> Self
pub fn flag(self, name: &str) -> Self
A boolean attribute, present without a value (hidden, open, disabled).
Sourcepub fn children(self, children: impl IntoIterator<Item = El>) -> Self
pub fn children(self, children: impl IntoIterator<Item = El>) -> Self
Add several children.
Sourcepub fn nodes(self, nodes: impl IntoIterator<Item = Node>) -> Self
pub fn nodes(self, nodes: impl IntoIterator<Item = Node>) -> Self
Add several nodes.
Sourcepub fn raw(self, markup: impl Into<String>) -> Self
pub fn raw(self, markup: impl Into<String>) -> Self
Add markup this process produced itself. Never repository content.
Trait Implementations§
impl Eq for El
impl StructuralPartialEq for El
Auto Trait Implementations§
impl Freeze for El
impl RefUnwindSafe for El
impl Send for El
impl Sync for El
impl Unpin for El
impl UnsafeUnpin for El
impl UnwindSafe for El
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.