pub struct NodeRef(pub Rc<Node>);
Tuple Fields§
§0: Rc<Node>
Implementations§
Source§impl NodeRef
impl NodeRef
pub(super) fn deep_clone(&self) -> Self
Source§impl NodeRef
impl NodeRef
fn len_update(&self, len: isize)
pub fn children(&self) -> Siblings ⓘ
pub fn len(&self) -> usize
pub fn update_len(e: &ElementData)
fn self_closing(name: &QualName) -> bool
fn base_len(name: &QualName) -> usize
Sourcepub fn new_element(name: QualName, attributes: Attributes) -> Self
pub fn new_element(name: QualName, attributes: Attributes) -> Self
Create a new element node.
Sourcepub fn new_comment(value: StrTendril) -> Self
pub fn new_comment(value: StrTendril) -> Self
Create a new comment node.
Sourcepub fn new_processing_instruction(target: StrTendril, data: StrTendril) -> Self
pub fn new_processing_instruction(target: StrTendril, data: StrTendril) -> Self
Create a new processing instruction node.
Sourcepub fn new_doctype(
name: StrTendril,
public_id: StrTendril,
system_id: StrTendril,
) -> Self
pub fn new_doctype( name: StrTendril, public_id: StrTendril, system_id: StrTendril, ) -> Self
Create a new doctype node.
Sourcepub fn new_document() -> Self
pub fn new_document() -> Self
Create a new document node.
Source§impl NodeRef
impl NodeRef
pub(super) fn do_notation(&self) -> NotationSpec
pub(super) fn do_op_notation(&self) -> OpNotation
pub(super) fn do_term(&self) -> Term
Methods from Deref<Target = Node>§
Sourcepub fn as_element(&self) -> Option<&ElementData>
pub fn as_element(&self) -> Option<&ElementData>
If this node is an element, return a reference to element-specific data.
Sourcepub fn as_document(&self) -> Option<&Cell<QuirksMode>>
pub fn as_document(&self) -> Option<&Cell<QuirksMode>>
If this node is a document, return a reference to element-specific data.
Sourcepub fn as_text(&self) -> Option<&RefCell<StrTendril>>
pub fn as_text(&self) -> Option<&RefCell<StrTendril>>
If this node is a text node, return a reference to its contents.
Sourcepub fn parent(&self) -> Option<NodeRef>
pub fn parent(&self) -> Option<NodeRef>
Return a reference to the parent node, unless this node is the root of the tree.
Sourcepub fn first_child(&self) -> Option<NodeRef>
pub fn first_child(&self) -> Option<NodeRef>
Return a reference to the first child of this node, unless it has no child.
Sourcepub fn last_child(&self) -> Option<NodeRef>
pub fn last_child(&self) -> Option<NodeRef>
Return a reference to the last child of this node, unless it has no child.
Sourcepub fn previous_sibling(&self) -> Option<NodeRef>
pub fn previous_sibling(&self) -> Option<NodeRef>
Return a reference to the previous sibling of this node, unless it is a first child.
Sourcepub fn next_sibling(&self) -> Option<NodeRef>
pub fn next_sibling(&self) -> Option<NodeRef>
Return a reference to the next sibling of this node, unless it is a last child.
Trait Implementations§
Source§impl FTMLNode for NodeRef
impl FTMLNode for NodeRef
type Ancestors<'a> = Ancestors
fn ancestors(&self) -> Self::Ancestors<'_>
fn with_elements<R>( &mut self, f: impl FnMut(Option<&mut FTMLElements>) -> R, ) -> R
fn delete(&self)
fn delete_children(&self)
fn range(&self) -> DocumentRange
fn inner_range(&self) -> DocumentRange
fn string(&self) -> String
fn inner_string(&self) -> String
fn as_notation(&self) -> Option<NotationSpec>
fn as_op_notation(&self) -> Option<OpNotation>
fn as_term(&self) -> Term
impl Eq for NodeRef
Auto Trait Implementations§
impl Freeze for NodeRef
impl !RefUnwindSafe for NodeRef
impl !Send for NodeRef
impl !Sync for NodeRef
impl Unpin for NodeRef
impl !UnwindSafe for NodeRef
Blanket Implementations§
§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
§type ArchivedMetadata = ()
type ArchivedMetadata = ()
The archived version of the pointer metadata for this type.
§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
Converts some archived metadata to the pointer metadata for itself.
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,
§impl<F, W, T, D> Deserialize<With<T, W>, D> for F
impl<F, W, T, D> Deserialize<With<T, W>, D> for F
§fn deserialize(
&self,
deserializer: &mut D,
) -> Result<With<T, W>, <D as Fallible>::Error>
fn deserialize( &self, deserializer: &mut D, ) -> Result<With<T, W>, <D as Fallible>::Error>
Deserializes using the given deserializer
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Converts
Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
, which can then be
downcast
into Box<dyn ConcreteType>
where ConcreteType
implements Trait
.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Converts
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
, which can then be further
downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Converts
&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Converts
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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