Skip to content

Releases: yvt/tokenlock

0.3.8

12 Jun 08:47
@yvt yvt
Compare
Choose a tag to compare

Added

  • Support for targets with limited or no atomics support (e.g., riscv32i-*, thumbv6m-*). Requires cfg(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

12 Jun 08:45
@yvt yvt
Compare
Choose a tag to compare

Added

  • SingletonTokenId: ConstDefault if the const-default_1 Cargo feature is enabled

0.3.6

12 Jun 08:45
@yvt yvt
Compare
Choose a tag to compare

Added

0.3.5

04 Sep 15:05
@yvt yvt
Compare
Choose a tag to compare

Added

  • New token types
    • IcToken (counter-based tokens)
    • BrandedToken and with_branded_token (a GhostCell implementation)
      • (Unstable) with_branded_token_async
  • Trait implementations
    • impl Display for {BadTokenError, SingletonTokenExhaustedError} when cfg(not(feature = "std"))
  • TokenLock operations
    • TokenLock::wrap, a constructor that default-initializes Keyhole: 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 of TokenLock<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 and ArcToken now only require cfg(feature = "alloc")
  • impl_singleton_token_factory! can now be applied to multiple types in a single macro call

0.3.4

31 Jan 13:44
@yvt yvt
Compare
Choose a tag to compare

Fixed

  • Preserve the Sync-ness variant when Deref-ing a SingletonTokenRefMut

0.3.3

31 Jan 13:05
@yvt yvt
Compare
Choose a tag to compare

Fixed

  • Fixed the crate failing to compile when building without std feature

0.3.2

31 Jan 10:23
@yvt yvt
Compare
Choose a tag to compare

Added

  • SingletonToken, a zero-sized token type
  • UnsyncTokenLock, which has more lenient requirements for Sync-ness provided that the token type is !Sync. You can store a Cell in UnsyncTokenLock, which will still be Sync.

Changed

  • Relaxed the requirements for TokenLock: Send, Sync.

0.3.1

13 Jun 14:12
@yvt yvt
Compare
Choose a tag to compare
  • Update README.md

0.3.0

06 Jun 11:49
@yvt yvt
Compare
Choose a tag to compare
  • Breaking: Raise the minimum supported Rust version to 1.34.2
  • Breaking: Rename TokenLock::{read → try_read, write → try_write}, introducing a panicking variation TokenLock::{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

0.2.3

06 Jun 11:46
@yvt yvt
Compare
Choose a tag to compare
  • Add TokenLock::{as_ptr, into_inner}
  • Support no_std