Expand description
§scsys
Welcome to scsys, this crate is tasked with providing a generic set of tools for the
scsys.io ecosystem. It is designed to be a foundational library that
helps establish a sense of consistency between individual efforts while working to reduce
its overall footprint through modularization and feature-gating. These characteristics make
it suitable for use both within the ecosystem and outside of it.
Modules§
- cont
- this module implements a set of traits and utilities for working with containers this module is focused on defining a set of traits and types for abstracting the behaviourds of an entity capable of storing some data.
- crypto
- cryptographic primitives and utilities implemented for the ecosystem
cryptographic primitives and utilities for the
scsysecosystem. - error
- this module implements various error-handling primitives and utilities ths module implements various error-handling primitives and utilities
- id
- this module defines the generic
Idwrapper and its implementations This module focuses on theIdimplementation, a generic wrapper type used to define various identifiers. TheIdtype is equipped with additional methods and traits to facilitate the creation and management of identifiers in a type-safe manner. - rand
- Utilities for random number generation
- rand_
distr - Generating random samples from probability distributions.
- state
- The
statemodule provides various abstractions and implementations for working with states within Rust. - time
- The
timemodule focuses on implementing various time-related features and utilities. It provides a genericTimestampalong with supporting traits and types to facilitate time management. - traits
- this module contains various traits commonly used throughout the scsys ecosystem
- types
- utils
- utilities for working with the scsys ecosystem
Macros§
- fmt_
wrapper Deprecated - Example
- get_
field - getter
- A procedural macro for generativly creating getter methods; i.e. $field_name() -> &$field_type and $field_name_mut() -> &mut $field_type
- gsw
- The
gswmacro generates getter and setter methods for the fields of a struct. At the moment, the macro can handle any type; for types that implement theCopytrait, simply drop the&to the left of each type. - wrapper
Structs§
- Id
Idis a generic identifier type that wraps a value of typeT.- Linear
Direction Iter - An iterator over the variants of LinearDirection
- Stage
Iter - An iterator over the variants of Stage
- State
Stateis generic over some typeQthat implements theRawStatetrait.- State
Base StateBaseis an abstract object that allows a particular kind of state to be associated with some generic stateQ- Timestamp
Timestampis a generic implementation of a type that represents some point in time.
Enums§
- Error
- Event
Stage - An
EventStageis a generic enumeration that represents the three stages of an event in a system, allowing for the association of a typeTwith each stage. The stages are: - Linear
Direction - The
LinearDirectionimplementation enumerates the three pssoible movements in one-dimensional space, namely: - Stage
Traits§
- Appellation
Appellationdefines a common interface for establishing a solid name for various entities.- Apply
Applyis a trait that allows for mapping over a reference to a typeTby applying a functionFto it, producing a new typeU. The result is wrapped in a container type defined by the implementor of the trait.- Apply
Mut - The
ApplyMuttrait allows for in-place mapping of a mutable reference to a typeT - Apply
Once - A the
ApplyOncetrait is similar to [Map], but it consumes the instance instead of borrowing it; - AsSlice
AsSliceis a generic trait for converting a type into a slice of its elements. This is useful for types that can be represented as a contiguous sequence of elements, such as arrays, vectors, or other collections.- AsSlice
Mut AsSliceMutis a generic trait for converting a type into a mutable slice of its elements.- DType
DTypeis a trait designed to provide additional information regarding the type of a particular value.- Decrement
Decrementdefines an interface for decrementing a value.- Decrement
Mut DecrementMutis a trait describing the ability to decrement a value in place. It is similar toDecrement, but it allows for mutable access to the value.- Decrement
Ref DecrementRefis a trait describing the ability to decrement a value by reference.- Displayable
Displayablesimply combines the two major traitscore::fmt::Debugandcore::fmt::Displayinto a single trait. This is useful for types that need to be displayed in a human-readable format, such as in debugging or logging.- Increment
Incrementdefines an interface for incrementing a value.- Increment
Mut IncrementMutis similar toIncrement, but it allows for incrementing a value in place.- Increment
Ref IncrementRefis similar toIncrement, but it allows for incrementing a value by reference.- Into
Inner - IntoInner is typically used for basic structures that wrap a single value.
- IsType
- The
IsTypetrait provides a method to check if the current type is of a specific type at runtime. This is useful for dynamic type checking in scenarios where the type may not be known at compile time. - Named
- Interface for nameable data-structures
- Now
- The
Nowtrait provides a common creation routines for all datetime implementations. - RawTimestamp
- A marker trait indicating types capable of representing a raw timestamp value.
- RawWrapper
- A
RawWrapperis the base trait defining all so-called “wrapper” types. - Remove
Fnl - This trait defines a method for removing the first and last entries within an entity.
- State
Repr - The
StateReprtrait defines the base type for stateful items, allowing for a generic item type to be associated with the state. - Stateful
Statefulis a trait establishing a common interface for all types that are state-aware.- String
Fmt StringFmtis a trait that provides methods for formatting strings. Note This crate requires theallocfeature- Symbolic
Symbolicdenotes a type consisting of some single or set of value(s) that can are considered displayable. Essentially, this trait is a wrapper around theDisplayabletrait enabling additional implementations- TypeOf
- The
TypeOftrait automatically provides a way to check if a type is of a specific type at compile time. This is useful for generic programming and type checking. - TypeTag
- Typically, TypeTag is used for uninitaliziable
enumswith no variants - Wrapper
- The
Wrappertrait is used to establish a common interface for all simplemented structures that “wrap” a single value. Essentially, any type capable of implementing#[repr(transparent)]can be considered a wrapper.
Type Aliases§
- BoxError
- Type alias for a boxed error with send, sync, and static flags enabled
- BoxResult
- Type alias for the standard result used
- NState
- A type alias for a
StateBaseequipped with aNarykind of state - Result
- a type alias for a
Resultthat uses the customErrortype
Derive Macros§
- Display
- the
Displaymacro automatically implements theDisplaytrait for a struct or enum, using thescsysattributes to customize the output. - Get
- GetMut
- Getter
- Set
- Variant
Constructors - This macro automatically generates functional constructors for all enclosed variants.
- With
- Wrapper
- The
Wrappermacro is designed for single-field structs, implementing additional methods supporting interactions with the inner value