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§

source

fn is_element(&self) -> bool

Returns false for NodeData::Text, true otherwise.

source

fn is_chars(&self) -> bool

Returns true for NodeData::Text, false otherwise.

source

fn borrow_chars(&self) -> Ref<'_, Chars>

Borrows a Chars reference.

Panics: will panic if &self is not a NodeData::Text node

source

fn borrow_element(&self) -> Ref<'_, Element>

Borrows an Element reference

Panics: will panic if &self is not a NodeData::Element node

source

fn borrow_element_mut(&mut self) -> RefMut<'_, Element>

Borrows an Element reference mutably

Panics: will panic if &self is not a NodeData::Element node

source

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

Implementations on Foreign Types§

source§

impl NodeBorrow for Node<NodeData>

Implementors§