#scsys #utilities #toolkit #primitive

macro scsys-derive

scsys is a collection of primitives and utilities for use throughout the ecosystem

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

Download history 19/week @ 2025-01-07 35/week @ 2025-01-14 35/week @ 2025-01-21 47/week @ 2025-01-28 48/week @ 2025-02-04 45/week @ 2025-02-11 20/week @ 2025-02-18 63/week @ 2025-02-25 29/week @ 2025-03-04 54/week @ 2025-03-11 60/week @ 2025-03-18 50/week @ 2025-03-25 23/week @ 2025-04-01 31/week @ 2025-04-08 36/week @ 2025-04-15 131/week @ 2025-04-22

221 downloads per month
Used in 22 crates (7 directly)

Apache-2.0

17KB
281 lines

scsys

crates.io docs license


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