pub enum ElementSelector {
Branch(bool),
Block(usize),
}Expand description
Selects a child Element within an Element. The selector must
match the parent type.
Variants§
Branch(bool)
Selects between the true and false paths of a Branch.
Block(usize)
Indexes into the children of a Block.
Implementations§
Source§impl ElementSelector
impl ElementSelector
Sourcepub fn as_path(&self) -> &ElementPath
pub fn as_path(&self) -> &ElementPath
Get this ElementSelector as an ElementPath slice.
Sourcepub fn as_mut_path(&mut self) -> &mut ElementPath
pub fn as_mut_path(&mut self) -> &mut ElementPath
Get this ElementSelector as a mut ElementPath slice.
Sourcepub fn unwrap_branch(self) -> bool
pub fn unwrap_branch(self) -> bool
Gets the branch boolean or panics.
Sourcepub fn unwrap_block(self) -> usize
pub fn unwrap_block(self) -> usize
Gets the block index or panics.
Sourcepub fn unwrap_branch_mut(&mut self) -> &mut bool
pub fn unwrap_branch_mut(&mut self) -> &mut bool
Mutably gets the branch boolean or panics.
Sourcepub fn unwrap_block_mut(&mut self) -> &mut usize
pub fn unwrap_block_mut(&mut self) -> &mut usize
Mutably gets the block index or panics.
Trait Implementations§
Source§impl Borrow<ElementPath> for ElementSelector
impl Borrow<ElementPath> for ElementSelector
Source§fn borrow(&self) -> &ElementPath
fn borrow(&self) -> &ElementPath
Immutably borrows from an owned value. Read more
Source§impl BorrowMut<ElementPath> for ElementSelector
impl BorrowMut<ElementPath> for ElementSelector
Source§fn borrow_mut(&mut self) -> &mut ElementPath
fn borrow_mut(&mut self) -> &mut ElementPath
Mutably borrows from an owned value. Read more
Source§impl Clone for ElementSelector
impl Clone for ElementSelector
Source§fn clone(&self) -> ElementSelector
fn clone(&self) -> ElementSelector
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ElementSelector
impl Debug for ElementSelector
Source§impl ElementIndex for ElementSelector
impl ElementIndex for ElementSelector
type PathSelectors = Once<ElementSelector>
fn path_selectors(self) -> Self::PathSelectors
Source§impl From<bool> for ElementSelector
impl From<bool> for ElementSelector
Source§impl From<usize> for ElementSelector
impl From<usize> for ElementSelector
Source§impl Hash for ElementSelector
impl Hash for ElementSelector
Source§impl Ord for ElementSelector
impl Ord for ElementSelector
Source§fn cmp(&self, other: &ElementSelector) -> Ordering
fn cmp(&self, other: &ElementSelector) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialEq for ElementSelector
impl PartialEq for ElementSelector
Source§impl PartialOrd for ElementSelector
impl PartialOrd for ElementSelector
impl Copy for ElementSelector
impl Eq for ElementSelector
impl StructuralPartialEq for ElementSelector
Auto Trait Implementations§
impl Freeze for ElementSelector
impl RefUnwindSafe for ElementSelector
impl Send for ElementSelector
impl Sync for ElementSelector
impl Unpin for ElementSelector
impl UnwindSafe for ElementSelector
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