Skip to content

[stable] Compile-time macros for building persistent data structures in no_std and const environments. Supports buffer composition, and numeric formatting.

License

Notifications You must be signed in to change notification settings

clucompany/cluConstData

Repository files navigation

[cluconstdata]

(Compile-time macros for building persistent data structures in no_std and const environments. Supports buffer composition, and numeric formatting.)

Usage

Add this to your Cargo.toml:

[dependencies]
cluConstData = "2.1.2"

and this to your source code:

use cluConstData::const_data;

Example

multi_consts

Purpose: Combine any values at compile time.

use cluConstData::const_data;

const_data! {
	pub(crate) const URL: &str = "https://", "api.example.com";
	const TIMEOUT_MS: u32 = 3000;
	const HEADERS: &[&str] = &["Accept"], &["Content-Type"];
}

fn main() {
	println!("Endpoint: {URL}");
	println!("Timeout: {TIMEOUT_MS} ms");
	println!("Headers: {HEADERS:?}");
}
See all

License

This project has a license according to (LICENSE-APACHE-2-0).

uproject  Copyright (c) 2019-2025 #UlinProject

 (Denis Kotlyarov).


Apache License

apache2  Licensed under the Apache License, Version 2.0.



About

[stable] Compile-time macros for building persistent data structures in no_std and const environments. Supports buffer composition, and numeric formatting.

Topics

Resources

License

Code of conduct

Stars

Watchers

Forks

Packages

No packages published

Contributors 3

  •  
  •  
  •  

Languages