#scsys #utilities #primitive #toolkit #ecosystem #build

no-std scsys

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

53 releases

Uses new Rust 2024

0.3.0 Jun 12, 2025
0.2.8 May 30, 2025
0.2.3 Sep 22, 2024
0.2.2 May 11, 2024
0.1.7 Jul 28, 2022

#341 in Magic Beans

Download history 54/week @ 2025-02-27 21/week @ 2025-03-06 31/week @ 2025-03-13 23/week @ 2025-03-20 29/week @ 2025-03-27 9/week @ 2025-04-03 25/week @ 2025-04-10 50/week @ 2025-04-17 273/week @ 2025-04-24 107/week @ 2025-05-01 140/week @ 2025-05-08 141/week @ 2025-05-15 273/week @ 2025-05-22 485/week @ 2025-05-29 401/week @ 2025-06-05 491/week @ 2025-06-12

1,703 downloads per month
Used in 56 crates (38 directly)

Apache-2.0

150KB
3K SLoC

scsys

crates.io docs.rs GitHub 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.

Usage

Before you start using scsys, make sure to add it as a dependency in your Cargo.toml file. You can do this by adding the following lines:

[dependencies.scsys]
default-features = true
features = []
version = "0.2.x"

Examples

Example 1: Using the VariantConstructors derive macro

The VariantConstructors 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::VariantConstructors
)
pub enum Sample {
    A,
    B(usize),
    C { x: f32, y: f32 },
}

we can automatically generate a functional constructors for each of the Sample variants:

let a = Sample::a();
let b = Sample::b(42);
let c = Sample::c(1.0, 2.0);
assert_eq!(a, Sample::A);
assert_eq!(b, Sample::B(42));
assert_eq!(c, Sample::C { x: 1.0, y: 2.0 });

Getting Started

Prerequisites

To build and run the scsys library, you will need to have the following tools installed on your machine:

  • Rust (with rustup for managing toolchains)
  • Cargo (the Rust package manager, which comes with Rust)
  • Git (for cloning the repository)

Rust

If you don't have rustup installed, you can install it by following the instructions on the official website.

curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
rustup

Once installed, you can use rustup to manage your Rust toolchain. This includes installing the latest stable version of Rust, as well as any other versions you may need for your projects. For now, we simply recommend using the latest stable version of Rust and making sure that any other toolchains you may have installed are up to date.

rustup update

Building from the source

Start by cloning the repository locally to your machine:

git clone https://github.com/scattered-systems/scsys.git --branch main

Then, navigate to the cloned directory:

cd scsys

cargo: use the built-in tool to manage the project

Build the project using the cargo build command:

cargo build -r --locked --workspace --all-features

Test the project using the cargo test command:

cargo test -r --locked --workspace --all-features

Or, benchmark the project using the cargo bench command:

cargo bench --verbose --workspace --all-features --

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

~0.6–4.5MB
~83K SLoC