[−][src]Struct html_types::node::Element
The html element type. This is the most common Note: if children is None, then it is handled as an empty element, this is different than having no children
Fields
name: Tag<'a>attributes: HashMap<Attribute<'a>, Option<Value<'a>>>children: TImplementations
impl<'a> Element<'a, Vec<Node<'a>>>[src]
pub fn push<N>(&mut self, node: N) where
N: Into<Node<'a>>, [src]
N: Into<Node<'a>>,
Pushes a child not into the element Note: you can also do this yourself, but this is nicer as it will coerce anything that can be a node into a node
pub fn anchor(url: Value<'a>, label: Text) -> Self[src]
Helper function to create a link given the label and url
pub fn body<N>(children: Vec<N>) -> Self where
N: Into<Node<'a>>, [src]
N: Into<Node<'a>>,
Creates a body element. Note consumes the children vector
pub fn html(
header: Element<'a, Vec<Node<'a>>>,
body: Element<'a, Vec<Node<'a>>>
) -> Self[src]
header: Element<'a, Vec<Node<'a>>>,
body: Element<'a, Vec<Node<'a>>>
) -> Self
Creates the html element Helper here assumes you have a body and header. as thats's used pretty much always
pub fn title(title: Text) -> Self[src]
Creates a html title, with the supplied text
impl<'a, T> Element<'a, T> where
T: ElementType, [src]
T: ElementType,
pub fn create(name: Tag<'a>) -> Self[src]
Creates a typical element with children, from the provided tag name. This is the typical case
pub fn set_bool_attribute(&mut self, key: Attribute<'a>)[src]
Sets the supplied attribute as a 'boolean' attribute This means it will just appear in the html, and will not render with a =value eg
pub fn set_attribute(&mut self, key: Attribute<'a>, value: Value<'a>)[src]
Sets the attribute to the supplied value Note: sugar over wrapping the value with some.
Trait Implementations
impl<'a, T: Clone> Clone for Element<'a, T> where
T: ElementType, [src]
T: ElementType,
impl<'a> From<Element<'a, ()>> for Node<'a>[src]
impl<'a> From<Element<'a, Vec<Node<'a>>>> for Node<'a>[src]
Auto Trait Implementations
impl<'a, T> RefUnwindSafe for Element<'a, T> where
T: RefUnwindSafe,
T: RefUnwindSafe,
impl<'a, T> Send for Element<'a, T> where
T: Send,
T: Send,
impl<'a, T> Sync for Element<'a, T> where
T: Sync,
T: Sync,
impl<'a, T> Unpin for Element<'a, T> where
T: Unpin,
T: Unpin,
impl<'a, T> UnwindSafe for Element<'a, T> where
T: UnwindSafe,
T: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized, [src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized, [src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T[src]
impl<T> From<T> for T[src]
impl<T, U> Into<U> for T where
U: From<T>, [src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone, [src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T[src]
fn clone_into(&self, target: &mut T)[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>, [src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>, [src]
U: TryFrom<T>,