Expand description
rspace is a fundmanetal crate looking to support containers via a set of well established
interfaces, traits, primitives, and other useful tools. The crate is working towards
becoming no_std compatible, seeking to support embedded and other resource constrained
environments. Additionally, the crate is extensively feature-gated to ensure it remains as
lightweight and modular as possible.
Modules§
- error
- this module defines the core error type for the crate
- point
- traits
- Various traits used to establish a solid foundation for defining and manipulating
containers, spaces, fields, and other related abstractions. The core trait,
RawSpace, is a fundamental building block for defining spaces (i.e. containers containing elements of a specific type). TheContainertrait builds uponRawSpaceto provide a more robust interface for containers and higher-kinded abstractions.
Structs§
- Point
- The
Pointimplementation is designed a generic, 2-dimensional point object used to define coordinates, vectors, or positions in a 2D space.
Enums§
- Error
- The custom error type for the crate.
Traits§
- Apply
Applyestablishes a binary operator for applying a given object, typically a function or closure, onto a target object, producing some output.- Apply
Mut - The
ApplyMuttrait defines an interface for objects capable of mutably borrowing themselves to apply the given function onto themselves or their elements to produce some output. - Apply
Once - The
ApplyOncetrait defines an interface for objects capable of consuming themselves to apply the given function onto themselves or their elements to produce some output. - Container
- The
Containertrait is a higher-kinded trait used to establish an interface for defining containers themselves. - Container
Index - Container
Iter - The
ContainerItertrait extends theContainertrait to provide an interface for obtaining iterators over the elements of the container. - Container
Iter Mut - Functor
Deprecated - The
Functortrait describes an interface for a higher-kinded type that can be mapped over. The trait is parameterized over a functionFand a target typeT, allowing for granular control over the mapping process itself, relying on associated types likeCont<U>to define the resulting container type after the mapping operation and theElemtype to specify the type of elements contained within the functor before the mapping operation is applied. Moreover, theapplymethod takes ownership of the functor allowing for distinct implementations for referenced, mutabled, and owned instances. - Get
Getdefines an interface for entities that can be accessed by a key; the design is similar to theIndextrait in the standard library, however, uses theBorrowtrait to allow for more flexible key types.- GetMut
GetMutdefines an interface for entities that can be accessed by a key; the design is similar to theIndexMuttrait in the standard library- MapInto
MapIntodefines an interface for containers capable of applying a given function onto each of their elements and consuming the container in the process, producing a new container containing the captured results of each invocation. The trait’s design allows implementors to specify the exact function signature and output type, utilizing associated type parameters to define the container and its current element type.- MapTo
- The
MapTotrait is similar toMapInto, but it operates on references to the container rather than consuming it. This allows for mapping functions over the elements of a container while retaining ownership of the original container. - RawSpace
- The
RawSpacetrait is used to define a base interface for all containers whose elements are of one specific type. - RawSpace
Mut RawSpaceMutis a trait that provides various mutable methods for accessing elements.- RawSpace
Ref RawSpaceRefis a trait that provides various read-only methods for accessing elements.- RawStore
- The
RawStoretrait is a marker trait for key-value store containers. - Scalar
Space ScalarSpacedefins a type of space that consists of a single element. This trait is useful in that it generally allows for a tensor-like treatment of scalar values within more complex mathematical structures.- Slice
Space SliceSpaceis used to define sequential collections, spaces, or containers that can be viewed as slices.- Slice
Space Mut SliceSpaceMutis used to define sequential collections, spaces, or containers that can be- Store
- The
Storetrait is used to define a key-value store container. - Store
Entry StoreEntryestablishes a common interface for entries within a key-value store.- TryApply
- TryApply
Mut - TryApply
Once
Type Aliases§
- Point
View - An instance of the
Pointimplementation containing owned references to the inner values. - Point
View Mut - An instance of the
Pointimplementation containing mutable references to the inner values. - RawPoint
- A
Pointwhose elements are raw pointers toXandY - RawPoint
Mut - A mutable
Pointwhose elements are raw pointers toXandY - Result
- a type alias for a
Resultconfigured to use the customErrortype.