cluConstData

Crates.iocluConstData
lib.rscluConstData
version2.1.2
created_at2019-05-06 17:31:21.251616+00
updated_at2025-08-01 22:49:30.731355+00
descriptionCompile-time macros for building persistent data structures in no_std and const environments. Supports buffer composition, and numeric formatting.
homepage
repositoryhttps://github.com/clucompany/cluConstData.git
max_upload_size
id132419
size58,139
Denis Kotlyarov (denisandroid)

documentation

README

Usage

Add this to your Cargo.toml:

[dependencies]
cluConstData = "2.1.1"

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 dual license according to (LICENSE-MIT) and (LICENSE-APACHE-2-0).

uproject  Copyright (c) 2019-2025 #UlinProject

 (Denis Kotlyarov).


Apache License

apache2  Licensed under the Apache License, Version 2.0.



Commit count: 0

cargo fmt