#[repr(C)]pub struct Dom {
pub root: NodeData,
pub children: DomVec,
/* private fields */
}
Expand description
The document model, similar to HTML. This is a create-only structure, you don’t actually read anything back
Fields§
§root: NodeData
§children: DomVec
Implementations§
Source§impl Dom
impl Dom
Sourcepub fn new(node_type: NodeType) -> Self
pub fn new(node_type: NodeType) -> Self
Creates an empty DOM with a give NodeType
. Note: This is a const fn
and
doesn’t allocate, it only allocates once you add at least one child node.
pub fn div() -> Self
pub fn body() -> Self
pub fn br() -> Self
pub fn text<S: Into<AzString>>(value: S) -> Self
pub fn image(image: ImageRef) -> Self
pub fn iframe(data: RefAny, callback: IFrameCallbackType) -> Self
pub fn swap_with_default(&mut self) -> Self
pub fn add_child(&mut self, child: Dom)
pub fn set_children(&mut self, children: DomVec)
pub fn copy_except_for_root(&mut self) -> Self
pub fn node_count(&self) -> usize
pub fn style(&mut self, css: CssApiWrapper) -> StyledDom
pub fn with_children(self, children: DomVec) -> Self
pub fn with_child(&mut self, child: Self) -> Self
pub fn with_tab_index(self, tab_index: TabIndex) -> Self
pub fn with_dataset(self, data: OptionRefAny) -> Self
pub fn with_ids_and_classes(self, ids_and_classes: IdOrClassVec) -> Self
pub fn with_callbacks(self, callbacks: CallbackDataVec) -> Self
pub fn with_inline_css_props( self, inline_css_props: NodeDataInlineCssPropertyVec, ) -> Self
pub fn set_inline_style(&mut self, style: &str)
pub fn with_inline_style(self, style: &str) -> Self
Trait Implementations§
Source§impl Extend<Dom> for DomVec
impl Extend<Dom> for DomVec
Source§fn extend<T: IntoIterator<Item = Dom>>(&mut self, iter: T)
fn extend<T: IntoIterator<Item = Dom>>(&mut self, iter: T)
Extends a collection with the contents of an iterator. Read more
Source§fn extend_one(&mut self, item: A)
fn extend_one(&mut self, item: A)
🔬This is a nightly-only experimental API. (
extend_one
)Extends a collection with exactly one element.
Source§fn extend_reserve(&mut self, additional: usize)
fn extend_reserve(&mut self, additional: usize)
🔬This is a nightly-only experimental API. (
extend_one
)Reserves capacity in a collection for the given number of additional elements. Read more
Source§impl FromIterator<Dom> for Dom
impl FromIterator<Dom> for Dom
Source§impl FromIterator<Dom> for DomVec
impl FromIterator<Dom> for DomVec
Source§impl Ord for Dom
impl Ord for Dom
Source§impl PartialOrd for Dom
impl PartialOrd for Dom
impl Eq for Dom
impl StructuralPartialEq for Dom
Auto Trait Implementations§
impl Freeze for Dom
impl RefUnwindSafe for Dom
impl Send for Dom
impl Sync for Dom
impl Unpin for Dom
impl UnwindSafe for Dom
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more