Crate sd_id128[][src]

GitHub release (latest by date) github test buy me a coffee donate@paypal

sd-id128 is a rust wrapper for sd-id128 in the systemd API of libsystemd. sd-id128 is part of the project.



This library is developed against the latest version of systemd. Unfortunately not all systems are up to date in that regard. Compatibility can be mastered using features. Each feature is named after the corresponding systemd version. The following features exist currently:

  • 240: Jan 12, 2019
  • 233: Mar 12, 2017

All features are in the default feature set. If required, default-features must be turned off. Features are stacking: if you select feature 240, you will get 233 included.


default, all features included for newest version of libsystemd:

sd-id128 = "1.0"

support for version 240+ / with features 233 and 240:

sd-id128 = {default-features=false, version="1.0", features=["240"]}

support for versions older than 233:

sd-id128 = {default-features=false, version="1.0"}


use sd_id128::{Case, Format, ID128};
let id128 = ID128::boot_id().unwrap();
println!("The boot id in RFC format is: {}", id128);
println!("The boot id in libsystemd format is: {}",
         id128.to_string_formatted(Format::LibSystemD, Case::Lower));



Wrapper for sd-id128 as offered in libsystemd.



Format of hexadecimal letters during transformation from an ID into text


Errors raised in sd-id128


String formats available during transformation from an ID into text