Struct b4s::SearchError
source · pub struct SearchError(pub Range<usize>);Expand description
Error returned in case of a failed search.
Thin wrapper
for Range<usize>, required to implement Error, achieving a useful
API.
Tuple Fields§
§0: Range<usize>Location of the last unsuccessful comparison.
This is not the location where the needle could be inserted. That location is either to the left or right of this location, depending on how comparison goes. As this error is not particularly actionable at runtime, the exact location (left, right) is not reported, saving computation at runtime and affording a simpler implementation.
Trait Implementations§
source§impl Clone for SearchError
impl Clone for SearchError
source§fn clone(&self) -> SearchError
fn clone(&self) -> SearchError
Returns a copy 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 SearchError
impl Debug for SearchError
source§impl Display for SearchError
impl Display for SearchError
source§impl Error for SearchError
impl Error for SearchError
1.30.0 · source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
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()
source§impl Hash for SearchError
impl Hash for SearchError
source§impl PartialEq<SearchError> for SearchError
impl PartialEq<SearchError> for SearchError
source§fn eq(&self, other: &SearchError) -> bool
fn eq(&self, other: &SearchError) -> bool
This method tests for
self and other values to be equal, and is used
by ==.impl Eq for SearchError
impl StructuralEq for SearchError
impl StructuralPartialEq for SearchError
Auto Trait Implementations§
impl RefUnwindSafe for SearchError
impl Send for SearchError
impl Sync for SearchError
impl Unpin for SearchError
impl UnwindSafe for SearchError
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