tomt_atom 0.1.1

Basic Atom (string) registry for use with ID strings. For when an application contains and passes around many constant strings (mainly de/serialized strings), this should reduce the overall memory footprint and slightly increase cache usage
Documentation

MIT/Apache 2.0 Crate Realease Doc

Brief

A basic Atom (string) registry for use with ID strings.

For when an application contains and passes around many constant strings (mainly de/serialized strings), this should reduce the overall memory footprint and slightly increase cache usage

Warning: The performance implications of this crate should be tested to ensure it's a good fit for your use-case. There are many sitatuations where such a caching mechanism is simply unnecessary and this crate may easily harm performance due to the memory allocation required to register an atom, as well as the hash-lookup.

Inspiration for this project:

Usage

To use TOMT_BevyCSS just add a StyleSheet with a loaded css file to any entity and all style sheet rules will be applied to the entity and all its [descendants][80] (children of children of children and so on).

use tomt_atom::Atom;

fn example_create()
{
    // Create atom directly with constructor
    let atom = Atom::new("From constructor");

    // Convert from any &str
    let atom: Atom = "From string".into();

    // Including String, or any &str-like object (impls AsRef<str>)
    let string = String::new("Example string");
    let atom = string.into();
}

Changelog

Version Changes
0.1.0 Initial-release
0.1.1 Fixed potential hash-collision bug

Contributing

Got some idea, feedback, question or found a bug? Feel free to open an issue at any time!

License

TOMT_Atom is dual-licensed under either:

This means you can select the license you prefer! This dual-licensing approach is the de-facto standard in the Rust ecosystem and there are [very good reasons][55] to include both.