GitXplorerGitXplorer
t

quick-error

public
335 stars
35 forks
18 issues

Commits

List of commits on branch master.
Verified
936a0683022e73086705de1985eccf5e69f5d5a0

Merge pull request #59 from Stonks3141/patch-1

ttailhook committed 2 years ago
Verified
2eaa144e9d8fa70047cfe5b001cdc9919f23f804

add docs for struct variants

SStonks3141 committed 2 years ago
Unverified
25ab982bb0c43130ae48485151f4a232eeab7d0c

Version bumped to v2.0.1

ttailhook committed 4 years ago
Verified
e7a85713f1bd1979a94ba4617e1178d263067dec

Merge pull request #56 from Byron/master

ttailhook committed 4 years ago
Verified
a344b67a327a138e8ff535bbad4dd4cdf4d7141d

Revert whitespace changes

BByron committed 4 years ago
Verified
bdad05be05bc3e5ed73aa0b8aef6a7a591a82c02

Add compatibility with 'deny(rust_2018_idioms)'

BByron committed 4 years ago

README

The README file for this repository.

=========== Quick Error

:Status: production-ready :Documentation: https://docs.rs/quick-error/

A macro which makes error types pleasant to write.

Features:

  • Define enum type with arbitrary parameters
  • Concise notation of Display and Error traits
  • Full control of Display and Error trait implementation
  • Any number of From traits
  • Support for all enum-variants Unit, Tuple and Struct

Here is the comprehensive example:

.. code-block:: rust

quick_error! {
    #[derive(Debug)]
    pub enum IoWrapper {
        Io(err: io::Error) {
            from()
            display("I/O error: {}", err)
            source(err)
        }
        Other(descr: &'static str) {
            display("Error {}", descr)
        }
        IoAt { place: &'static str, err: io::Error } {
            source(err)
            display(me) -> ("io error at {}: {}", place, err)
            from(s: String) -> {
                place: "some string",
                err: io::Error::new(io::ErrorKind::Other, s)
            }
        }
        Discard {
            from(&'static str)
        }
    }
}

======= License

Licensed under either of

at your option.


Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.