diff --git a/Cargo.lock b/Cargo.lock index 80dee5e77..7711a8297 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -200,6 +200,15 @@ dependencies = [ "typenum", ] +[[package]] +name = "deranged" +version = "0.5.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7cd812cc2bc1d69d4764bd80df88b4317eaef9e773c75226407d9bc0876b211c" +dependencies = [ + "powerfmt", +] + [[package]] name = "digest" version = "0.10.7" @@ -416,6 +425,28 @@ version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8f42a60cbdf9a97f5d2305f08a87dc4e09308d1276d28c869c684d7777685682" +[[package]] +name = "jiff" +version = "0.2.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a3546dc96b6d42c5f24902af9e2538e82e39ad350b0c766eb3fbf2d8f3d8359" +dependencies = [ + "jiff-static", + "portable-atomic", + "portable-atomic-util", +] + +[[package]] +name = "jiff-static" +version = "0.2.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2a8c8b344124222efd714b73bb41f8b5120b27a7cc1c75593a6ff768d9d05aa4" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "leb128fmt" version = "0.1.0" @@ -499,6 +530,12 @@ dependencies = [ "libc", ] +[[package]] +name = "num-conv" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "51d515d32fb182ee37cda2ccdcb92950d6a3c2893aa280e540671c2cd0f3b1d9" + [[package]] name = "once_cell" version = "1.21.4" @@ -530,6 +567,27 @@ version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b4596b6d070b27117e987119b4dac604f3c58cfb0b191112e24771b2faeac1a6" +[[package]] +name = "portable-atomic" +version = "1.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c33a9471896f1c69cecef8d20cbe2f7accd12527ce60845ff44c153bb2a21b49" + +[[package]] +name = "portable-atomic-util" +version = "0.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "091397be61a01d4be58e7841595bd4bfedb15f1cd54977d79b8271e94ed799a3" +dependencies = [ + "portable-atomic", +] + +[[package]] +name = "powerfmt" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391" + [[package]] name = "prettyplease" version = "0.2.37" @@ -890,6 +948,24 @@ dependencies = [ "syn", ] +[[package]] +name = "time" +version = "0.3.45" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f9e442fc33d7fdb45aa9bfeb312c095964abdf596f7567261062b2a7107aaabd" +dependencies = [ + "deranged", + "num-conv", + "powerfmt", + "time-core", +] + +[[package]] +name = "time-core" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b36ee98fd31ec7426d599183e8fe26932a8dc1fb76ddb6214d05493377d34ca" + [[package]] name = "toml" version = "1.0.7+spec-1.1.0" @@ -965,9 +1041,11 @@ version = "0.36.1" dependencies = [ "bitflags 2.11.0", "cfg-if", + "jiff", "log", "ptr_meta", "qemu-exit", + "time", "ucs2", "uefi-macros", "uefi-raw", diff --git a/Cargo.toml b/Cargo.toml index 155fb93f4..77d6df882 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -22,7 +22,9 @@ rust-version = "1.88" [workspace.dependencies] bitflags = "2.0.0" log = { version = "0.4.5", default-features = false } +jiff = { version = "0.2", default-features = false } ptr_meta = { version = "0.3.0", default-features = false, features = ["derive"] } +time = { version = "0.3", default-features = false } uguid = "2.2.1" [patch.crates-io] diff --git a/uefi/CHANGELOG.md b/uefi/CHANGELOG.md index 45826f65a..5a733a816 100644 --- a/uefi/CHANGELOG.md +++ b/uefi/CHANGELOG.md @@ -19,6 +19,12 @@ - Added `Handle::component_name()` and `Handle::device_path()` to simplify the common use-case of querying more information about a handle. - Added `fs::path::Path::join()`. +- Integration of `Time` with `time` crate + - `TryFrom`: `time::PrimitiveDateTime <--> Time` (without timezone) + - `TryFrom`: `time::OffsetDateTime <--> Time` (with timezone) +- Integration of `Time` with `jiff` crate + - `TryFrom`: `jiff::DateTime <--> Time` (without timezone) + - `TryFrom`: `jiff::Zoned <--> Time` (with timezone) ## Changed - export all `text::{input, output}::*` types @@ -42,6 +48,8 @@ - **Breaking:** Renamed `DevicePathNode::to_string()` to `DevicePathNode::to_string16()` to better differentiate with the new `to_string()` coming from the new `Display`. +- `runtime::set_time()` now consumes `&T` where `T: Clone + TryInto