| 1 | [package] |
| 2 | name = "once_cell" |
| 3 | version = "1.21.3" |
| 4 | authors = ["Aleksey Kladov <aleksey.kladov@gmail.com>" ] |
| 5 | license = "MIT OR Apache-2.0" |
| 6 | edition = "2021" |
| 7 | rust-version = "1.65" |
| 8 | |
| 9 | description = "Single assignment cells and lazy values." |
| 10 | readme = "README.md" |
| 11 | documentation = "https://docs.rs/once_cell" |
| 12 | |
| 13 | repository = "https://github.com/matklad/once_cell" |
| 14 | keywords = ["lazy" , "static" ] |
| 15 | categories = ["rust-patterns" , "memory-management" ] |
| 16 | |
| 17 | exclude = ["*.png" , "*.svg" , "/Cargo.lock.msrv" , "rustfmt.toml" ] |
| 18 | |
| 19 | [workspace] |
| 20 | members = ["xtask" ] |
| 21 | |
| 22 | [dependencies] |
| 23 | parking_lot_core = { version = "0.9.10" , optional = true, default-features = false } |
| 24 | portable-atomic = { version = "1.8" , optional = true, default-features = false } |
| 25 | critical-section = { version = "1.1.3" , optional = true } |
| 26 | |
| 27 | [dev-dependencies] |
| 28 | regex = "1.10.6" |
| 29 | critical-section = { version = "1.1.3" , features = ["std" ] } |
| 30 | |
| 31 | [features] |
| 32 | default = ["std" ] |
| 33 | |
| 34 | # Enables `once_cell::sync` module. |
| 35 | std = ["alloc" ] |
| 36 | |
| 37 | # Enables `once_cell::race::OnceBox` type. |
| 38 | alloc = ["race" ] |
| 39 | |
| 40 | # Enables `once_cell::race` module. |
| 41 | race = [] |
| 42 | |
| 43 | # Uses parking_lot to implement once_cell::sync::OnceCell. |
| 44 | # This makes no speed difference, but makes each OnceCell<T> |
| 45 | # up to 16 bytes smaller, depending on the size of the T. |
| 46 | parking_lot = ["dep:parking_lot_core" ] |
| 47 | |
| 48 | # Uses `portable-atomic` to implement `race` module. in |
| 49 | # `#![no_std]` mode. Please read `portable-atomic` docs carefully |
| 50 | # before enabling this feature. |
| 51 | portable-atomic = ["dep:portable-atomic" ] |
| 52 | |
| 53 | # Uses `critical-section` to implement `sync` module. in |
| 54 | # `#![no_std]` mode. Please read `critical-section` docs carefully |
| 55 | # before enabling this feature. |
| 56 | # `portable-atomic` feature is enabled for backwards compatibility. |
| 57 | critical-section = ["dep:critical-section" , "portable-atomic" ] |
| 58 | |
| 59 | # Enables semver-exempt APIs of this crate. |
| 60 | # At the moment, this feature is unused. |
| 61 | unstable = [] |
| 62 | |
| 63 | # Only for backwards compatibility. |
| 64 | atomic-polyfill = ["critical-section" ] |
| 65 | |
| 66 | [[example]] |
| 67 | name = "bench" |
| 68 | required-features = ["std" ] |
| 69 | |
| 70 | [[example]] |
| 71 | name = "bench_acquire" |
| 72 | required-features = ["std" ] |
| 73 | |
| 74 | [[example]] |
| 75 | name = "lazy_static" |
| 76 | required-features = ["std" ] |
| 77 | |
| 78 | [[example]] |
| 79 | name = "reentrant_init_deadlocks" |
| 80 | required-features = ["std" ] |
| 81 | |
| 82 | [[example]] |
| 83 | name = "regex" |
| 84 | required-features = ["std" ] |
| 85 | |
| 86 | [[example]] |
| 87 | name = "test_synchronization" |
| 88 | required-features = ["std" ] |
| 89 | |
| 90 | [package.metadata.docs.rs] |
| 91 | all-features = true |
| 92 | rustdoc-args = ["--generate-link-to-definition" ] |
| 93 | |