current

Crates.iocurrent
lib.rscurrent
version
sourcesrc
created_at2015-01-13 21:21:13.299134+00
updated_at2025-03-22 17:02:01.777965+00
descriptionA library for setting current values for stack scope, such as application structure
homepagehttps://github.com/pistondevelopers/current
repositoryhttps://github.com/pistondevelopers/current.git
max_upload_size
id780
Cargo.toml error:TOML parse error at line 21, column 1 | 21 | autolib = false | ^^^^^^^ unknown field `autolib`, expected one of `name`, `version`, `edition`, `authors`, `description`, `readme`, `license`, `repository`, `homepage`, `documentation`, `build`, `resolver`, `links`, `default-run`, `default_dash_run`, `rust-version`, `rust_dash_version`, `rust_version`, `license-file`, `license_dash_file`, `license_file`, `licenseFile`, `license_capital_file`, `forced-target`, `forced_dash_target`, `autobins`, `autotests`, `autoexamples`, `autobenches`, `publish`, `metadata`, `keywords`, `categories`, `exclude`, `include`
size0
publish (github:pistondevelopers:publish)

documentation

README

Current

A library for setting current values for stack scope, such as application structure

Current objects are put on a shadow stack for easy access by type. The type is used as an identifier to get the latest current object in scope.

This is used as a better alternative in Rust than mutable globals.

There are two objects in this library:

  • CurrentGuard is used to create a current object using a mutable reference
  • Current is used to access the reference by type

How to use it

See Best coding practices with current objects

Commit count: 132

cargo fmt