pub enum ExactlyOneError {
Empty,
MoreThanOne(usize),
}Expand description
Error produced when expecting exactly one node from a query
Variants§
Empty
The query resulted in an empty NodeList
MoreThanOne(usize)
The query resulted in a NodeList containing more than one node
Implementations§
Source§impl ExactlyOneError
impl ExactlyOneError
Sourcepub fn is_more_than_one(&self) -> bool
pub fn is_more_than_one(&self) -> bool
Check that it is the MoreThanOne variant
Sourcepub fn as_more_than_one(&self) -> Option<usize>
pub fn as_more_than_one(&self) -> Option<usize>
Extract the number of nodes, if it was more than one, or None otherwise
Trait Implementations§
Source§impl Debug for ExactlyOneError
impl Debug for ExactlyOneError
Source§impl Display for ExactlyOneError
impl Display for ExactlyOneError
Source§impl Error for ExactlyOneError
impl Error for ExactlyOneError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()
Auto Trait Implementations§
impl Freeze for ExactlyOneError
impl RefUnwindSafe for ExactlyOneError
impl Send for ExactlyOneError
impl Sync for ExactlyOneError
impl Unpin for ExactlyOneError
impl UnwindSafe for ExactlyOneError
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