Trait rsvg::node::NodeBorrow
source · pub trait NodeBorrow {
// Required methods
fn is_element(&self) -> bool;
fn is_chars(&self) -> bool;
fn borrow_chars(&self) -> Ref<'_, Chars>;
fn borrow_element(&self) -> Ref<'_, Element>;
fn borrow_element_mut(&mut self) -> RefMut<'_, Element>;
fn borrow_element_data(&self) -> Ref<'_, ElementData>;
}
Expand description
Helper trait to get different NodeData variants
Required Methods§
sourcefn is_element(&self) -> bool
fn is_element(&self) -> bool
Returns false
for NodeData::Text, true
otherwise.
sourcefn borrow_chars(&self) -> Ref<'_, Chars>
fn borrow_chars(&self) -> Ref<'_, Chars>
Borrows a Chars
reference.
Panics: will panic if &self
is not a NodeData::Text
node
sourcefn borrow_element(&self) -> Ref<'_, Element>
fn borrow_element(&self) -> Ref<'_, Element>
Borrows an Element
reference
Panics: will panic if &self
is not a NodeData::Element
node
sourcefn borrow_element_mut(&mut self) -> RefMut<'_, Element>
fn borrow_element_mut(&mut self) -> RefMut<'_, Element>
Borrows an Element
reference mutably
Panics: will panic if &self
is not a NodeData::Element
node
sourcefn borrow_element_data(&self) -> Ref<'_, ElementData>
fn borrow_element_data(&self) -> Ref<'_, ElementData>
Borrows an ElementData
reference to the concrete element type.
Panics: will panic if &self
is not a NodeData::Element
node