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
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 text<S: Into<AzString>>(value: S) -> Self
pub fn text<S: Into<AzString>>(value: S) -> Self
Shorthand for NodeData::new(NodeType::Text(value.into()))
pub fn iframe(data: RefAny, callback: IFrameCallbackType) -> Self
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 is_text_node(&self) -> bool
pub const fn get_node_type(&self) -> &NodeType
pub fn get_dataset_mut(&mut self) -> &mut OptionRefAny
pub const fn get_dataset(&self) -> &OptionRefAny
pub const fn get_ids_and_classes(&self) -> &IdOrClassVec
pub const fn get_callbacks(&self) -> &CallbackDataVec
pub const fn get_inline_css_props(&self) -> &NodeDataInlineCssPropertyVec
pub fn get_clip_mask(&self) -> Option<&ImageMask>
pub fn get_tab_index(&self) -> Option<&TabIndex>
pub fn get_accessibility_info(&self) -> Option<&Box<AccessibilityInfo>>
pub fn set_node_type(&mut self, node_type: NodeType)
pub fn set_dataset(&mut self, data: OptionRefAny)
pub fn set_ids_and_classes(&mut self, ids_and_classes: IdOrClassVec)
pub fn set_callbacks(&mut self, callbacks: CallbackDataVec)
pub fn set_inline_css_props( &mut self, inline_css_props: NodeDataInlineCssPropertyVec, )
pub fn set_clip_mask(&mut self, clip_mask: ImageMask)
pub fn set_tab_index(&mut self, tab_index: TabIndex)
pub fn set_accessibility_info(&mut self, accessibility_info: AccessibilityInfo)
pub fn add_callback( &mut self, event: EventFilter, data: RefAny, callback: CallbackType, )
pub fn add_id(&mut self, s: AzString)
pub fn add_class(&mut self, s: AzString)
pub fn add_normal_css_property(&mut self, p: CssProperty)
pub fn add_hover_css_property(&mut self, p: CssProperty)
pub fn add_active_css_property(&mut self, p: CssProperty)
pub fn add_focus_css_property(&mut self, p: CssProperty)
Sourcepub fn calculate_node_data_hash(&self) -> DomNodeHash
pub fn calculate_node_data_hash(&self) -> DomNodeHash
Calculates a deterministic node hash for this node
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 swap_with_default(&mut self) -> Self
pub fn copy_special(&self) -> Self
pub fn is_focusable(&self) -> bool
pub fn get_iframe_node(&mut self) -> Option<&mut IFrameNode>
pub fn get_render_image_callback_node<'a>( &'a mut self, ) -> Option<(&'a mut ImageCallback, ImageRefHash)>
pub fn debug_print_start( &self, css_cache: &CssPropertyCache, node_id: &NodeId, node_state: &StyledNodeState, ) -> String
pub fn debug_print_end(&self) -> String
Trait Implementations§
Source§impl Extend<NodeData> for NodeDataVec
impl Extend<NodeData> for NodeDataVec
Source§fn extend<T: IntoIterator<Item = NodeData>>(&mut self, iter: T)
fn extend<T: IntoIterator<Item = NodeData>>(&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<NodeData> for NodeDataVec
impl FromIterator<NodeData> for NodeDataVec
Source§impl Ord for NodeData
impl Ord for NodeData
Source§impl PartialOrd for NodeData
impl PartialOrd for NodeData
impl Eq for NodeData
impl Send for NodeData
impl StructuralPartialEq for NodeData
Auto Trait Implementations§
impl Freeze for NodeData
impl RefUnwindSafe 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§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