[−][src]Struct azul_core::dom::Dom
The document model, similar to HTML. This is a create-only structure, you don't actually read anything back
Fields
root: NodeData
children: Vec<Dom>
Implementations
impl Dom
[src]
pub const fn new(node_type: NodeType) -> Self
[src]
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 with_capacity(node_type: NodeType, cap: usize) -> Self
[src]
Creates an empty DOM with space reserved for cap
nodes
pub const fn div() -> Self
[src]
Shorthand for Dom::new(NodeType::Div)
.
pub const fn body() -> Self
[src]
Shorthand for Dom::new(NodeType::Body)
.
pub fn label<S: Into<DomString>>(value: S) -> Self
[src]
Shorthand for Dom::new(NodeType::Label(value.into()))
pub const fn text_id(text_id: TextId) -> Self
[src]
Shorthand for Dom::new(NodeType::Text(text_id))
pub const fn image(image: ImageId) -> Self
[src]
Shorthand for Dom::new(NodeType::Image(image_id))
pub fn gl_texture<I: Into<RefAny>>(callback: GlCallbackType, ptr: I) -> Self
[src]
Shorthand for Dom::new(NodeType::GlTexture((callback, ptr)))
pub fn iframe<I: Into<RefAny>>(callback: IFrameCallbackType, ptr: I) -> Self
[src]
Shorthand for Dom::new(NodeType::IFrame((callback, ptr)))
pub fn add_child(&mut self, child: Self)
[src]
Adds a child DOM to the current DOM
pub fn with_id<S: Into<DomString>>(self, id: S) -> Self
[src]
Same as id
, but easier to use for method chaining in a builder-style pattern
pub fn with_class<S: Into<DomString>>(self, class: S) -> Self
[src]
Same as id
, but easier to use for method chaining in a builder-style pattern
pub fn with_callback<O: Into<EventFilter>>(
self,
on: O,
callback: CallbackType,
ptr: RefAny
) -> Self
[src]
self,
on: O,
callback: CallbackType,
ptr: RefAny
) -> Self
Same as event
, but easier to use for method chaining in a builder-style pattern
pub fn with_child(self, child: Self) -> Self
[src]
pub fn with_css_override<S: Into<DomString>>(
self,
id: S,
property: CssProperty
) -> Self
[src]
self,
id: S,
property: CssProperty
) -> Self
pub fn with_tab_index(self, tab_index: TabIndex) -> Self
[src]
pub fn is_draggable(self, draggable: bool) -> Self
[src]
pub fn add_id<S: Into<DomString>>(&mut self, id: S)
[src]
pub fn add_class<S: Into<DomString>>(&mut self, class: S)
[src]
pub fn add_callback<O: Into<EventFilter>>(
&mut self,
on: O,
callback: CallbackType,
ptr: RefAny
)
[src]
&mut self,
on: O,
callback: CallbackType,
ptr: RefAny
)
pub fn add_css_override<S: Into<DomString>, P: Into<CssProperty>>(
&mut self,
override_id: S,
property: P
)
[src]
&mut self,
override_id: S,
property: P
)
pub fn set_tab_index(&mut self, tab_index: TabIndex)
[src]
pub fn set_draggable(&mut self, draggable: bool)
[src]
pub fn get_html_string(&self) -> String
[src]
Returns a HTML-formatted version of the DOM for easier debugging, i.e.
Dom::div().with_id("hello") .with_child(Dom::div().with_id("test"))
will return:
<div id="hello">
<div id="test" />
</div>
Trait Implementations
impl Clone for Dom
[src]
fn clone(&self) -> Self
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Debug for Dom
[src]
impl Eq for Dom
[src]
impl From<Dom> for CompactDom
[src]
impl FromIterator<Dom> for Dom
[src]
fn from_iter<I: IntoIterator<Item = Dom>>(iter: I) -> Self
[src]
impl FromIterator<NodeData> for Dom
[src]
fn from_iter<I: IntoIterator<Item = NodeData>>(iter: I) -> Self
[src]
impl FromIterator<NodeType> for Dom
[src]
fn from_iter<I: IntoIterator<Item = NodeType>>(iter: I) -> Self
[src]
impl PartialEq<Dom> for Dom
[src]
Auto Trait Implementations
impl !RefUnwindSafe for Dom
impl !Send for Dom
impl !Sync for Dom
impl Unpin for Dom
impl !UnwindSafe for Dom
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>,