pub enum LodashError {
InvalidInput {
message: String,
},
TypeConversion {
from: String,
to: String,
},
IndexOutOfBounds {
index: usize,
size: usize,
},
EmptyCollection,
InvalidPredicate {
message: String,
},
Custom {
message: String,
},
}Expand description
Main error type for Lodash-RS operations.
Variants§
InvalidInput
Invalid input data Invalid input provided to a function.
TypeConversion
Type conversion error Type conversion error.
Fields
IndexOutOfBounds
Index out of bounds Index out of bounds error.
EmptyCollection
Empty collection operation
InvalidPredicate
Invalid predicate function Invalid predicate function error.
Custom
Custom error from user-provided functions Custom error with a specific message.
Implementations§
Source§impl LodashError
impl LodashError
Sourcepub fn invalid_input(message: impl Into<String>) -> Self
pub fn invalid_input(message: impl Into<String>) -> Self
Create a new invalid input error.
Sourcepub fn type_conversion(from: impl Into<String>, to: impl Into<String>) -> Self
pub fn type_conversion(from: impl Into<String>, to: impl Into<String>) -> Self
Create a new type conversion error.
Sourcepub fn index_out_of_bounds(index: usize, size: usize) -> Self
pub fn index_out_of_bounds(index: usize, size: usize) -> Self
Create a new index out of bounds error.
Sourcepub fn empty_collection() -> Self
pub fn empty_collection() -> Self
Create a new empty collection error.
Sourcepub fn invalid_predicate(message: impl Into<String>) -> Self
pub fn invalid_predicate(message: impl Into<String>) -> Self
Create a new invalid predicate error.
Trait Implementations§
Source§impl Clone for LodashError
impl Clone for LodashError
Source§fn clone(&self) -> LodashError
fn clone(&self) -> LodashError
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 LodashError
impl Debug for LodashError
Source§impl Display for LodashError
impl Display for LodashError
Source§impl Error for LodashError
impl Error for LodashError
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()
Source§impl PartialEq for LodashError
impl PartialEq for LodashError
impl StructuralPartialEq for LodashError
Auto Trait Implementations§
impl Freeze for LodashError
impl RefUnwindSafe for LodashError
impl Send for LodashError
impl Sync for LodashError
impl Unpin for LodashError
impl UnwindSafe for LodashError
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> SafeClone for Twhere
T: Clone,
impl<T> SafeClone for Twhere
T: Clone,
Source§fn safe_clone(&self) -> T
fn safe_clone(&self) -> T
Safely clone the value.