Releases: yvt/tokenlock
Releases · yvt/tokenlock
0.3.8
Added
- Support for targets with limited or no atomics support (e.g.,
riscv32i-*
,thumbv6m-*
). Requirescfg(target_has_atomic = ...)
, which was stabilized in Rust 1.60.0.
Fixed
impl_singleton_token_factory!
is now more resistant to exotic environments (e.g.,type bool = u32
in an outer scope).
0.3.7
Added
SingletonTokenId:
ConstDefault
if theconst-default_1
Cargo feature is enabled
0.3.6
Added
const-default_1
Cargo feature, which enables the implementation ofConstDefault
fromconst-default ^1
.
0.3.5
Added
- New token types
IcToken
(counter-based tokens)BrandedToken
andwith_branded_token
(a GhostCell implementation)- (Unstable)
with_branded_token_async
- (Unstable)
- Trait implementations
impl Display for {BadTokenError, SingletonTokenExhaustedError}
whencfg(not(feature = "std"))
TokenLock
operationsTokenLock::wrap
, a constructor that default-initializesKeyhole: TokenId
, provided for convenience*TokenLock::{set, try_set}
, which assign a new value and discard the old one
TokenLock
variants[Unsync]PinTokenLock
- Miscellaneous
SingletonTokenLock<T, Tag>
(an alias ofTokenLock<T, SingletonTokenId<Tag>>
) and its variants
Changed
- Raise the minimum supported Rust version to 1.54.0 (MSRV changes are not considered semver-breaking anymore.)
RcToken
andArcToken
now only requirecfg(feature = "alloc")
impl_singleton_token_factory!
can now be applied to multiple types in a single macro call
0.3.4
0.3.3
0.3.2
Added
SingletonToken
, a zero-sized token typeUnsyncTokenLock
, which has more lenient requirements forSync
-ness provided that the token type is!Sync
. You can store aCell
inUnsyncTokenLock
, which will still beSync
.
Changed
- Relaxed the requirements for
TokenLock: Send, Sync
.
0.3.1
0.3.0
- Breaking: Raise the minimum supported Rust version to 1.34.2
- Breaking: Rename
TokenLock::{read → try_read, write → try_write}
, introducing a panicking variationTokenLock::{read, write}
of these methods - Add
TokenLock::{get, try_get, replace, replace_with, try_replace_with, clone, try_clone, swap, try_swap, take, try_take}
- Implement
Default