Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Difference From swctx-0.1.1 To swctx-0.2.0
2023-08-14
| ||
21:30 | Add --generate-link-to-definition to rustdoc. check-in: fb0d7a6b05 user: jan tags: trunk | |
2023-08-10
| ||
15:40 | Add some test comments. check-in: cab5919dd1 user: jan tags: swctx-0.2.0, trunk | |
15:28 | Release maintenance. check-in: 369d9fded8 user: jan tags: trunk | |
15:15 | Merge. check-in: b2f56db268 user: jan tags: trunk | |
2023-08-09
| ||
13:30 | Experimenting with generalized SetCtx state. check-in: e69956c141 user: jan tags: generalized-setctx-state | |
2023-08-08
| ||
07:22 | Release maintenance. check-in: 580e75c17c user: jan tags: swctx-0.1.1, trunk | |
07:19 | Add try_get() as a non-blocking alternative to wait(). check-in: c6619994a8 user: jan tags: trunk | |
Changes to Cargo.toml.
1 2 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | - + - + | [package] name = "swctx" |
︙ |
Changes to README.md.
1 2 | 1 2 3 4 5 | - + | # swctx |
Changes to src/err.rs.
1 2 3 4 5 6 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | - - + + - - + - - + + - - - - + - - + | //! Error management module. use std::fmt; /// Errors that can be returned by the `swctx` library. #[derive(Debug, PartialEq)] |
︙ | |||
37 38 39 40 41 42 43 | 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 | - + - + - + - + - - - | match self { Error::App(e) => e, _ => panic!("Not an Error::App") } } } |
Changes to src/lib.rs.
1 2 3 4 5 6 7 | 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 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 | - + - + - - + + - - + - - - - - - + + + - - + - + - + - - - - + - - + + + - - + + - + | //! _swctx_ is very similar to a one-shot channel, but with some added //! semantics. //! //! ``` //! use std::thread; //! use swctx::mkpair; //! |
︙ | |||
94 95 96 97 98 99 100 | 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 | - - + + - - + + - + + + + - + + | panic!("Unexpected state"); } } } } |
︙ |
Changes to src/sctx.rs.
1 2 3 4 5 6 7 8 9 | 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 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 | - + - - + + + + + + + + + + + + + + + + + + + + + + + + - - + + + + + - - - + + - - + - - - + + - + | use std::sync::Arc; use crate::err::Error; use super::{Shared, State}; /// End-point used to send value to the paired [`WaitCtx`](super::WaitCtx). #[repr(transparent)] |
︙ | |||
58 59 60 61 62 63 64 | 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 | - + + + + - - - - - + | pub fn fail(self, error: E) { let mut inner = self.0.inner.lock(); inner.state = State::Err(Error::App(error)); self.0.notify_waiter(&mut inner); } } |
Changes to src/wctx.rs.
︙ | |||
8 9 10 11 12 13 14 | 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 | + - + - + - + - + | use crate::err::Error; use super::{Shared, State}; /// End-point used to wait for a value to be sent from the paired /// [`SetCtx`](super::SetCtx). #[repr(transparent)] |
︙ | |||
48 49 50 51 52 53 54 | 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 | - + - + - + - - + + | /// /// Returns `Ok(Some(T))` if a value has been stored. Returns `Ok(None)` if /// no value has been stored. /// /// # Panic /// This function will panic if called again after it has resolved to either /// data or error. |
︙ |
Changes to tests/errors.rs.
1 2 3 4 5 6 7 | 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 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 | + + + + + + + - + + - + - + + - + - + - + - + - + - + - + - + - + | use std::thread; use swctx::{mkpair, Error}; #[derive(Clone, Debug, Default, PartialEq)] enum State { #[default] Abort, NoReply } // Trigger an abortion error before wait is called (hopefully). #[test] fn abort_before_wait() { |
︙ |
Changes to tests/errors_async.rs.
1 2 3 4 5 6 7 8 9 | 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 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 | + + + + + + + - + - + - + - + - + - + - + - + - + - + - + - + | use std::thread; use swctx::{mkpair, Error}; #[derive(Clone, Debug, Default, PartialEq)] enum State { #[default] Abort, NoReply } // Trigger an abortion error before wait is called (hopefully). #[test] fn abort_before_wait() { let tokrt = tokio::runtime::Runtime::new().unwrap(); |
︙ |
Changes to tests/simple.rs.
1 2 3 4 5 6 | 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 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 | - + + - + + - + + - + + | use std::{thread, time}; use swctx::mkpair; #[test] fn say_hello_before_wait() { |
︙ |
Changes to www/changelog.md.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | + + + + + + + | # Change Log ## [Unreleased] ### Added ### Changed ### Removed ## [0.2.0] - 2023-08-10 ### Changed - Generalize `SetCtx` state. ## [0.1.1] - 2023-08-08 ### Added - Add a `try_get()` as a non-blocking alternative to `wait()`. |
︙ |