pub struct NodeData { /* private fields */ }
Expand description
Represents one single DOM node (node type, classes, ids and callbacks are stored here)
Implementations§
Source§impl NodeData
impl NodeData
pub fn debug_print_start(&self, close_self: bool) -> String
pub fn debug_print_end(&self) -> String
Source§impl NodeData
impl NodeData
Sourcepub const fn new(node_type: NodeType) -> Self
pub const fn new(node_type: NodeType) -> Self
Creates a new NodeData
instance from a given NodeType
Sourcepub fn is_node_type(&self, searched_type: NodeType) -> bool
pub fn is_node_type(&self, searched_type: NodeType) -> bool
Checks whether this node is of the given node type (div, image, text)
Sourcepub fn has_class(&self, class: &str) -> bool
pub fn has_class(&self, class: &str) -> bool
Checks whether this node has the searched class attached
pub fn calculate_node_data_hash(&self) -> DomHash
Sourcepub fn label<S: Into<DomString>>(value: S) -> Self
pub fn label<S: Into<DomString>>(value: S) -> Self
Shorthand for NodeData::new(NodeType::Label(value.into()))
Sourcepub const fn text_id(text_id: TextId) -> Self
pub const fn text_id(text_id: TextId) -> Self
Shorthand for NodeData::new(NodeType::Text(text_id))
Sourcepub const fn image(image: ImageId) -> Self
pub const fn image(image: ImageId) -> Self
Shorthand for NodeData::new(NodeType::Image(image_id))
Sourcepub fn gl_texture(callback: GlCallbackType, ptr: RefAny) -> Self
pub fn gl_texture(callback: GlCallbackType, ptr: RefAny) -> Self
Shorthand for NodeData::new(NodeType::GlTexture((callback, ptr)))
Sourcepub fn iframe(callback: IFrameCallbackType, ptr: RefAny) -> Self
pub fn iframe(callback: IFrameCallbackType, ptr: RefAny) -> Self
Shorthand for NodeData::new(NodeType::IFrame((callback, ptr)))
pub const fn get_node_type(&self) -> &NodeType
pub const fn get_ids(&self) -> &Vec<DomString>
pub const fn get_classes(&self) -> &Vec<DomString>
pub const fn get_callbacks(&self) -> &Vec<(EventFilter, (Callback, RefAny))>
pub const fn get_dynamic_css_overrides(&self) -> &Vec<(DomString, CssProperty)>
pub const fn get_is_draggable(&self) -> bool
pub const fn get_tab_index(&self) -> Option<TabIndex>
pub fn set_node_type(&mut self, node_type: NodeType)
pub fn set_ids(&mut self, ids: Vec<DomString>)
pub fn set_classes(&mut self, classes: Vec<DomString>)
pub fn set_callbacks( &mut self, callbacks: Vec<(EventFilter, (Callback, RefAny))>, )
pub fn set_dynamic_css_overrides( &mut self, dynamic_css_overrides: Vec<(DomString, CssProperty)>, )
pub fn set_is_draggable(&mut self, is_draggable: bool)
pub fn set_tab_index(&mut self, tab_index: Option<TabIndex>)
pub fn with_node_type(self, node_type: NodeType) -> Self
pub fn with_ids(self, ids: Vec<DomString>) -> Self
pub fn with_classes(self, classes: Vec<DomString>) -> Self
pub fn with_callbacks( self, callbacks: Vec<(EventFilter, (Callback, RefAny))>, ) -> Self
pub fn with_dynamic_css_overrides( self, dynamic_css_overrides: Vec<(DomString, CssProperty)>, ) -> Self
pub fn is_draggable(self, is_draggable: bool) -> Self
pub fn with_tab_index(self, tab_index: Option<TabIndex>) -> Self
Trait Implementations§
Source§impl FromIterator<NodeData> for Dom
impl FromIterator<NodeData> for Dom
impl Eq for NodeData
Auto Trait Implementations§
impl Freeze for NodeData
impl !RefUnwindSafe for NodeData
impl !Send for NodeData
impl !Sync for NodeData
impl Unpin for NodeData
impl !UnwindSafe for NodeData
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§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)