Enum novax_data::DataError
source · pub enum DataError {
Address(AddressError),
Utils(UtilsError),
}Expand description
Enumerates the centralized error handling types across different operations.
DataError serves as a unified error type that aggregates different error types from
various operations into a single enum. This centralization facilitates error handling
across different parts of the codebase.
Variants
Address(AddressError): Encapsulates errors that occur during address-related operations, as represented by theAddressErrorenum.Utils(UtilsError): Encapsulates errors that occur within utility functions, as represented by theUtilsErrorenum.
Example
let address_error = AddressError::InvalidBech32String;
let data_error: DataError = address_error.into();
match data_error {
DataError::Address(err) => println!("Address error: {:?}", err),
DataError::Utils(err) => println!("Utils error: {:?}", err),
}Variants§
Address(AddressError)
Represents an error from address-related operations.
Utils(UtilsError)
Represents an error from utility functions.
Trait Implementations§
source§impl<'de> Deserialize<'de> for DataError
impl<'de> Deserialize<'de> for DataError
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl From<AddressError> for DataError
impl From<AddressError> for DataError
Provides a conversion from AddressError to DataError.
This implementation allows for an AddressError to be converted into a DataError,
facilitating centralized error handling.
source§fn from(value: AddressError) -> Self
fn from(value: AddressError) -> Self
Converts to this type from the input type.
source§impl From<UtilsError> for DataError
impl From<UtilsError> for DataError
Provides a conversion from UtilsError to DataError.
This implementation allows for a UtilsError to be converted into a DataError,
facilitating centralized error handling.
source§fn from(value: UtilsError) -> Self
fn from(value: UtilsError) -> Self
Converts to this type from the input type.
source§impl PartialEq for DataError
impl PartialEq for DataError
impl StructuralPartialEq for DataError
Auto Trait Implementations§
impl CodecFromSelf for DataError
impl RefUnwindSafe for DataError
impl Send for DataError
impl Sync for DataError
impl Unpin for DataError
impl UnwindSafe for DataError
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