Index: .efiles ================================================================== --- .efiles +++ .efiles @@ -1,7 +1,9 @@ Cargo.toml README.md +www/index.md +www/changelog.md src/err.rs src/lib.rs src/server.rs src/client.rs src/rctx.rs @@ -9,7 +11,5 @@ src/rctx/inner.rs src/rctx/public.rs tests/*.rs examples/*.rs benches/*.rs -www/index.md -www/changelog.md Index: Cargo.toml ================================================================== --- Cargo.toml +++ Cargo.toml @@ -1,8 +1,8 @@ [package] name = "ump" -version = "0.10.2" +version = "0.11.0" authors = ["Jan Danielsson "] edition = "2018" license = "0BSD" categories = [ "concurrency", "asynchronous" ] keywords = [ "channel", "threads", "sync", "message-passing" ] @@ -15,11 +15,10 @@ ".efiles", ".fossil-settings", ".fslckout", "examples", "rustfmt.toml", - "tests", "www" ] [features] dev-docs = [] Index: src/err.rs ================================================================== --- src/err.rs +++ src/err.rs @@ -3,11 +3,11 @@ /// Module-specific error codes. #[derive(Debug)] pub enum Error { /// The server object has shut down. /// - /// This happens when clients: + /// Happens when clients: /// - attempt to transmit messages to a server that has been deallocated. /// - have their requests dropped from the serrver's queue because the /// server itself was deallocated. ServerDisappeared, @@ -28,16 +28,22 @@ /// [`channel`](crate::channel()). App(E) } impl Error { + /// Attempt to convert [`Error`] into application-specific error. pub fn into_apperr(self) -> Option { match self { Error::App(e) => Some(e), _ => None } } + + /// Unwrap application-specific error from an [`Error`]. + /// + /// # Panic + /// Panics if `Error` variant is not `Error::App()`. pub fn unwrap_apperr(self) -> E { match self { Error::App(e) => e, _ => panic!("Not an Error::App") } Index: src/rctx/public.rs ================================================================== --- src/rctx/public.rs +++ src/rctx/public.rs @@ -1,6 +1,9 @@ -use crate::rctx::{err::Error, inner::State, InnerReplyContext}; +use crate::{ + rctx::{inner::State, InnerReplyContext}, + Error +}; /// Context used to transmit a reply back to the originating requester. #[cfg_attr( feature = "dev-docs", doc = r#" Index: www/changelog.md ================================================================== --- www/changelog.md +++ www/changelog.md @@ -3,13 +3,28 @@ ## [Unreleased] ### Added ### Changed + +- Include tests when publishing crate. +- Bugfix: Use `err::Error` rather than `rctx::err::Error` in rctx::public, + giving `ReplyContext::reply()` and `ReplyContext::fail()` the correct return + types. ### Removed + +## [0.11.0] - 2023-07-29 + +### Changed + +- Include tests when publishing crate. +- Bugfix: Use `err::Error` rather than `rctx::err::Error` in rctx::public, + giving `ReplyContext::reply()` and `ReplyContext::fail()` the correct return + types. + ## [0.10.2] - 2023-07-28 ### Added