pub fn prev_sibling(&self) -> Selection<'a> {
        let mut result = Vec::with_capacity(self.length());
        let mut set = HashSet::with_capacity(self.length());

        for node in self.nodes() {
            if let Some(sibling) = node.prev_element_sibling() {
                if !set.contains(&sibling.id) {
                    set.insert(sibling.id);
                    result.push(sibling);
                }
            }
        }

        Self { nodes: result }
    }
/// Gets the immediately previous sibling of each element in the
/// selection. It returns a new Selection object containing these elements.
Gets the immediately previous sibling of each element in the
selection. It returns a new Selection object containing these elements.
Gets the immediately previous sibling of each element in the selection . It returns a new Selection object containing these elements .
pub fn prev_sibling(&self) -> Selection<'a> {
        let mut result = Vec::with_capacity(self.length());
        let mut set = HashSet::with_capacity(self.length());
        for node in self.nodes() {
            if let Some(sibling) = node.prev_element_sibling() {
                if !set.contains(&sibling.id) {
                    set.insert(sibling.id);
                    result.push(sibling);
                }
            }
        }
        Self { nodes: result }
    }
pub fn prev_sibling ( & self ) -> Selection < ' a > { let mut result = Vec :: with_capacity ( self . length ( ) ) ; let mut set = HashSet :: with_capacity ( self . length ( ) ) ; for node in self . nodes ( ) { if let Some ( sibling ) = node . prev_element_sibling ( ) { if ! set . contains ( & sibling . id ) { set . insert ( sibling . id ) ; result . push ( sibling ) ; } } } Self { nodes : result } }
Gets the immediately previous sibling of each element in the
selection.
Gets the immediately previous sibling of each element in the selection .
&self
&self