pub struct NodeList<'a, Ext: 'static> { /* private fields */ }Expand description
Snapshot of node ids captured at construction. item(i) and
iter() resolve against the borrowed &Dom; if a node has
been removed since the snapshot, the resolution returns None
for that slot (filtered out by iter()).
Implementations§
Source§impl<'a, Ext: 'static> NodeList<'a, Ext>
impl<'a, Ext: 'static> NodeList<'a, Ext>
Sourcepub fn from_ids(
dom: &'a Dom<Ext>,
nodes: impl IntoIterator<Item = NodeId>,
) -> Self
pub fn from_ids( dom: &'a Dom<Ext>, nodes: impl IntoIterator<Item = NodeId>, ) -> Self
Construct from an iterator of node ids and a borrowed Dom.
Used by Dom::query_selector_all (M4b step 18) and tests.
Sourcepub fn item(&self, index: usize) -> Option<NodeRef<'a, Ext>>
pub fn item(&self, index: usize) -> Option<NodeRef<'a, Ext>>
Borrow the i-th node if (a) the index is in range and
(b) the underlying id still resolves to a live node. DOM
item(i).
Auto Trait Implementations§
impl<'a, Ext> !RefUnwindSafe for NodeList<'a, Ext>
impl<'a, Ext> !Send for NodeList<'a, Ext>
impl<'a, Ext> !Sync for NodeList<'a, Ext>
impl<'a, Ext> !UnwindSafe for NodeList<'a, Ext>
impl<'a, Ext> Freeze for NodeList<'a, Ext>
impl<'a, Ext> Unpin for NodeList<'a, Ext>
impl<'a, Ext> UnsafeUnpin for NodeList<'a, Ext>where
&'a Dom<Ext>: UnsafeUnpin,
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