Crate scsys_traits

Source
Expand description

§scsys-traits

A collection of useful traits designed to be used throughout the ecosystem.

Modules§

cont
this module implements a set of traits used to establish a common interface for containers and other generic storage types.
convert
dtype
named
ops
string
symbolic
toggle
wrapper

Traits§

Appellation
Appellation defines a common interface for establishing a solid name for various entities.
Apply
Apply is a trait that allows for mapping over a reference to a type T by applying a function F to it, producing a new type U. The result is wrapped in a container type defined by the implementor of the trait.
ApplyMut
The ApplyMut trait allows for in-place mapping of a mutable reference to a type T
ApplyOnce
A the ApplyOnce trait is similar to [Map], but it consumes the instance instead of borrowing it;
AsSlice
AsSlice is 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.
AsSliceMut
AsSliceMut is a generic trait for converting a type into a mutable slice of its elements.
Container
The Container trait is a higher-level abstraction over RawContainer.
Context
DType
DType is a trait designed to provide additional information regarding the type of a particular value.
Decrement
Decrement defines an interface for decrementing a value.
DecrementMut
DecrementMut is a trait describing the ability to decrement a value in place. It is similar to Decrement, but it allows for mutable access to the value.
DecrementRef
DecrementRef is a trait describing the ability to decrement a value by reference.
Displayable
Displayable simply combines the two major traits core::fmt::Debug and core::fmt::Display into a single trait. This is useful for types that need to be displayed in a human-readable format, such as in debugging or logging.
Functor
The Functor trait extends the HKT trait to provide a way to map over its content(s) using a function f that transforms values of type T into values of type U.
Get
Get defines an interface for entities that can be accessed by a key; the design is similar to the Index trait in the standard library, however, uses the Borrow trait to allow for more flexible key types.
GetMut
GetMut defines an interface for entities that can be accessed by a key; the design is similar to the IndexMut trait in the standard library
HKT
The HKT trait defines an interface for higher-kinded types (HKT).
Increment
Increment defines an interface for incrementing a value.
IncrementMut
IncrementMut is similar to Increment, but it allows for incrementing a value in place.
IncrementRef
IncrementRef is similar to Increment, but it allows for incrementing a value by reference.
IntoInner
IntoInner is typically used for basic structures that wrap a single value.
IsType
KeyedContainer
Named
Interface for nameable data-structures
RawContainer
RawContainer defines a standard interface for all containers that are used to store other entities.
RawWrapper
A RawWrapper is the base trait defining all so-called “wrapper” types.
RemoveFnl
This trait defines a method for removing the first and last entries within an entity.
Store
StringFmt
StringFmt is a trait that provides methods for formatting strings. Note This crate requires the alloc feature
Symbolic
Symbolic denotes a type consisting of some single or set of value(s) that can are considered displayable. Essentially, this trait is a wrapper around the Displayable trait enabling additional implementations
TypeOf
TypeTag
Typically, TypeTag is used for uninitaliziable enums with no variants
Wrapper
The Wrapper trait 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.