Expand description
Basic exceptions handling mechanism.
§Module :: werror
Basic exceptions handling mechanism.
§Basic use-case.
fn main()
{
let err = f1();
println!( "{err:#?}" );
// < Err(
// < BasicError {
// < msg: "Some error",
// < },
// < )
}
fn f1() -> werror::Result< () >
{
let _read = std::fs::read_to_string( "Cargo.toml" )?;
Err( werror::BasicError::new( "Some error" ).into() )
}
§To add to your project
cargo add werror
§Try out from the repository
git clone https://github.com/Wandalen/wTools
cd wTools
cargo run --example werror_tools_trivial
Modules§
- assert
- Assertions.
- dependency
- Dependencies.
- error
- Alias for std::error::BasicError.
- exposed
- Exposed namespace of the module.
- for_app
- Exceptions handling mechanism for apps.
- for_lib
- Exceptions handling mechanism for libs.
- orphan
- Shared with parent namespace of the module
- prelude
- Prelude to use essentials:
use my_module::prelude::*
. - protected
- Protected namespace of the module.
Macros§
- debug_
assert_ id - Macro asserts that two expressions are identical to each other. Unlike std::assert_eq it is removed from a release build.
- debug_
assert_ identical - Macro asserts that two expressions are identical to each other. Unlike std::assert_eq it is removed from a release build. Alias of debug_assert_id.
- debug_
assert_ ni - Macro asserts that two expressions are not identical to each other. Unlike std::assert_eq it is removed from a release build.
- debug_
assert_ not_ identical - Macro asserts that two expressions are not identical to each other. Unlike std::assert_eq it is removed from a release build.
- err
- Macro to generate an error descriptor.
- return_
err - Macro to return an Err( error ) generating error descriptor.
Structs§
- Basic
Error - baic implementation of generic BasicError
Traits§
- Error
Interface Error
is a trait representing the basic expectations for error values, i.e., values of typeE
inResult<T, E>
.
Type Aliases§
- Result
Result<T, Error>