39 releases
Uses new Rust 2024
new 0.2.4 | Apr 29, 2025 |
---|---|
0.2.3 | Sep 22, 2024 |
0.2.2 | May 11, 2024 |
0.2.0 | Mar 16, 2024 |
0.1.35 | Nov 29, 2022 |
#38 in #scsys
221 downloads per month
Used in 22 crates
(7 directly)
17KB
281 lines
scsys
Warning: the library is still in the early stages of development so make sure to use with caution!
Welcome to scsys
, a collection of useful utilities, types, and other primitives that are used in various projects developed by Scattered Systems. The library is designed to be a general-purpose utility library that can be used in any Rust project, aiming to provide a standardized set of tools that can be used to build robust and reliable software.
Getting Started
Prerequisites
Rust Toolchain
Make sure you have the latest version of the Rust toolchain installed on your system.
rustup update
If you don't have it installed, you can install it by following the instructions on the official website.
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
Building from the source
Clone the repository
Start by cloning the repository locally to your machine.
git clone https://github.com/scattered-systems/scsys.git
cd scsys
Building Locally
cargo build --all-features -v --workspace
Testing
Automatically format and analyze the codebase before building then testing.
cargo test --all-features -r -v --workspace
Usage
Add the dependency to your project
[dependencies.scsys]
features = ["full"]
version = "0.2.*"
Examples
Example: Using the Getter
derive macro
The Getter
derive macro can be used to automatically generate functional accessors for named fields within a given structure. For example, given the following structure:
#[derive(Clone, Copy, Debug, Default, Eq, Hash, Ord, PartialEq, PartialOrd, scsys::Getter)]
pub struct Node<T> {
pub weight: T,
}
we can automatically generate a getter method for the weight
field:
let node = Node { weight: 42 };
assert_eq!(node.weight(), 42);
License
Licensed under the Apache License, Version 2.0, (LICENSE-APACHE)
Contribution
Contributions are welcome, however, ensure that you have read the CONTRIBUTING.md file before submitting a pull request.
Dependencies
~215–650KB
~16K SLoC