5 unstable releases

0.3.2 Jan 31, 2023
0.3.1 Nov 4, 2022
0.3.0 May 28, 2022
0.2.0 Feb 28, 2022
0.1.0 Aug 15, 2021

#770 in Unix APIs

Download history 5/week @ 2024-07-29 18/week @ 2024-09-23

56 downloads per month
Used in 2 crates

Apache-2.0 OR BSD-3-Clause

26KB
449 lines

nydus-app

The nydus-app crate is a collection of utilities to help creating applications for Nydus Image Service project, which provides:

  • struct BuildTimeInfo: application build and version information.
  • fn dump_program_info(): dump program build and version information.
  • fn setup_logging(): setup logging infrastructure for application.

Support

Platforms:

  • x86_64
  • aarch64

Operating Systems:

  • Linux

Usage

Add nydus-app as a dependency in Cargo.toml

[dependencies]
nydus-app = "*"

Then add extern crate nydus-app; to your crate root if needed.

Examples

  • Setup application infrastructure.
#[macro_use(crate_authors, crate_version)]
extern crate clap;

use clap::App;
use std::io::Result;
use nydus_app::{BuildTimeInfo, setup_logging};

fn main() -> Result<()> {
    let level = cmd.value_of("log-level").unwrap().parse().unwrap();
    let (bti_string, build_info) = BuildTimeInfo::dump();
    let _cmd = App::new("")
        .version(bti_string.as_str())
        .author(crate_authors!())
        .get_matches();

    setup_logging(None, level)?;
    print!("{}", build_info);
    
    Ok(())
}

License

This code is licensed under Apache-2.0.

Dependencies

~8–15MB
~215K SLoC