ump

Check-in Differences
Login

Check-in Differences

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Difference From ump-0.10.2 To ump-0.11.0

2023-07-29
02:10
Make a note about project status. check-in: eb09b3724b user: jan tags: trunk
2023-07-28
22:19
Release maintenance. check-in: bfeac614fd user: jan tags: trunk, ump-0.11.0
22:11
Return the correct Error type from ReplyContext methods. Documentation updates. check-in: 8ef3a429d7 user: jan tags: trunk
04:12
Include tests in packaging. check-in: bca62b6697 user: jan tags: trunk
01:44
Release maintenance. check-in: 27099be4a4 user: jan tags: trunk, ump-0.10.2
01:25
Rename 'send' message operation to 'request'. Add dev-docs feature for including internal notes to generated documentation. check-in: fb98947448 user: jan tags: trunk

Changes to .efiles.

1
2


3
4
5
6
7
8
9
10
11
12
13
14
15
Cargo.toml
README.md


src/err.rs
src/lib.rs
src/server.rs
src/client.rs
src/rctx.rs
src/rctx/err.rs
src/rctx/inner.rs
src/rctx/public.rs
tests/*.rs
examples/*.rs
benches/*.rs
www/index.md
www/changelog.md


>
>











<
<
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15


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
src/rctx/err.rs
src/rctx/inner.rs
src/rctx/public.rs
tests/*.rs
examples/*.rs
benches/*.rs


Changes to Cargo.toml.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
[package]
name = "ump"
version = "0.10.2"
authors = ["Jan Danielsson <jan.danielsson@qrnch.com>"]
edition = "2018"
license = "0BSD"
categories = [ "concurrency", "asynchronous" ]
keywords = [ "channel", "threads", "sync", "message-passing" ]
repository = "https://repos.qrnch.tech/pub/ump"
description = "Micro message passing library for threads/tasks communication."
rust-version = "1.39"

# Can't exclude "benches", because the [[bench]] section will fail.
exclude = [
  ".efiles",
  ".fossil-settings",
  ".fslckout",
  "examples",
  "rustfmt.toml",
  "tests",
  "www"
]

[features]
dev-docs = []

[dependencies]


|
















<







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19

20
21
22
23
24
25
26
[package]
name = "ump"
version = "0.11.0"
authors = ["Jan Danielsson <jan.danielsson@qrnch.com>"]
edition = "2018"
license = "0BSD"
categories = [ "concurrency", "asynchronous" ]
keywords = [ "channel", "threads", "sync", "message-passing" ]
repository = "https://repos.qrnch.tech/pub/ump"
description = "Micro message passing library for threads/tasks communication."
rust-version = "1.39"

# Can't exclude "benches", because the [[bench]] section will fail.
exclude = [
  ".efiles",
  ".fossil-settings",
  ".fslckout",
  "examples",
  "rustfmt.toml",

  "www"
]

[features]
dev-docs = []

[dependencies]

Changes to src/err.rs.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
use std::fmt;

/// Module-specific error codes.
#[derive(Debug)]
pub enum Error<E> {
  /// The server object has shut down.
  ///
  /// This 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,

  /// No more client end-points remain.
  ///







|







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
use std::fmt;

/// Module-specific error codes.
#[derive(Debug)]
pub enum Error<E> {
  /// The server object has shut down.
  ///
  /// 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,

  /// No more client end-points remain.
  ///
26
27
28
29
30
31
32

33
34
35
36
37
38





39
40
41
42
43
44
45
  ///
  /// The `E` type is typically declared as the third generic parameter to
  /// [`channel`](crate::channel()).
  App(E)
}

impl<E> Error<E> {

  pub fn into_apperr(self) -> Option<E> {
    match self {
      Error::App(e) => Some(e),
      _ => None
    }
  }





  pub fn unwrap_apperr(self) -> E {
    match self {
      Error::App(e) => e,
      _ => panic!("Not an Error::App")
    }
  }
}







>






>
>
>
>
>







26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
  ///
  /// The `E` type is typically declared as the third generic parameter to
  /// [`channel`](crate::channel()).
  App(E)
}

impl<E> Error<E> {
  /// Attempt to convert [`Error`] into application-specific error.
  pub fn into_apperr(self) -> Option<E> {
    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")
    }
  }
}

Changes to src/rctx/public.rs.


1


2
3
4
5
6
7
8

use crate::rctx::{err::Error, inner::State, InnerReplyContext};



/// Context used to transmit a reply back to the originating requester.
#[cfg_attr(
  feature = "dev-docs",
  doc = r#"
# Internals
Public-facing sender part of the `ReplyContext` object.
>
|
>
>







1
2
3
4
5
6
7
8
9
10
11
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#"
# Internals
Public-facing sender part of the `ReplyContext` object.

Changes to www/changelog.md.

1
2
3
4
5
6
7





8
9
10










11
12
13
14
15
16
17
# Change Log

## [Unreleased]

### Added

### Changed






### Removed












## [0.10.2] - 2023-07-28

### Added

- Add `send()`/`asend()` wrappers around the new `req()`/`areq()` methods with
  a deprecation notice.







>
>
>
>
>



>
>
>
>
>
>
>
>
>
>







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# Change Log

## [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

- Add `send()`/`asend()` wrappers around the new `req()`/`areq()` methods with
  a deprecation notice.