awaitable-error-0.1.0/.cargo_vcs_info.json0000644000000001550000000000100141130ustar { "git": { "sha1": "637d6b1bffdae213d2132f4554d95e98be4d5318" }, "path_in_vcs": "awaitable-error" }awaitable-error-0.1.0/Cargo.toml0000644000000014570000000000100121170ustar # THIS FILE IS AUTOMATICALLY GENERATED BY CARGO # # When uploading crates to the registry Cargo will automatically # "normalize" Cargo.toml files for maximal compatibility # with all versions of Cargo and also rewrite `path` dependencies # to registry (e.g., crates.io) dependencies. # # If you are reading this file be aware that the original Cargo.toml # will likely look very different (and much more reasonable). # See Cargo.toml.orig for the original contents. [package] edition = "2018" name = "awaitable-error" version = "0.1.0" authors = ["Jiahao XU "] description = "Awaitable type with input and output that can be stored in container." keywords = [ "async", "utilities", ] categories = ["asynchronous"] license = "MIT" repository = "https://github.com/NobodyXu/awaitable" awaitable-error-0.1.0/Cargo.toml.orig000064400000000000000000000005241046102023000155720ustar 00000000000000[package] name = "awaitable-error" version = "0.1.0" edition = "2018" authors = ["Jiahao XU "] license = "MIT" description = "Awaitable type with input and output that can be stored in container." repository = "https://github.com/NobodyXu/awaitable" keywords = ["async", "utilities"] categories = ["asynchronous"] awaitable-error-0.1.0/src/lib.rs000064400000000000000000000012601046102023000146040ustar 00000000000000use std::{error, fmt}; #[derive(Debug)] #[non_exhaustive] pub enum Error { /// Awaitable is not initialized yet. Uninitialized, /// Awaitable is already consumed but not yet reset. AlreadyConsumed, /// Awaitable is marked done twice. AlreadyDone, } impl fmt::Display for Error { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { use Error::*; f.write_str(match self { Uninitialized => "Awaitable is not initialized yet.", AlreadyConsumed => "Awaitable is already consumed but not yet reset.", AlreadyDone => "Awaitable is marked done twice.", }) } } impl error::Error for Error {}