Crate rspace_traits

Crate rspace_traits 

Source
Expand description

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). The Container trait builds upon RawSpace to provide a more robust interface for containers and higher-kinded abstractions.

Modules§

container
functor
ops
This module provides various operations traits and implementations for musical concepts
space
This module defines the RawSpace trait alongside other interfaces for immutable and mutable access to the inner elements of a container.
store
this module defines traits for key-value stores and their entries

Traits§

Apply
Apply defines an interface for objects capable of applying the given function onto itself or its elements to produce some output.
ApplyMut
The ApplyMut trait defines an interface for objects capable of mutably borrowing themselves to apply the given function onto themselves or their elements to produce some output.
ApplyOnce
The ApplyOnce trait 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 Container trait is a higher-kinded trait used to establish an interface for defining containers themselves.
ContainerIndex
ContainerIter
The ContainerIter trait extends the Container trait to provide an interface for obtaining iterators over the elements of the container.
ContainerIterMut
Functor
The Functor trait describes an interface for a higher-kinded type that can be mapped over. The trait is parameterized over a function F and a target type T, allowing for granular control over the mapping process itself, relying on associated types like Cont<U> to define the resulting container type after the mapping operation and the Elem type to specify the type of elements contained within the functor before the mapping operation is applied. Moreover, the apply method takes ownership of the functor allowing for distinct implementations for referenced, mutabled, and owned instances.
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
MapInto
MapInto describes a consuming interface for containers that enables the mapping of a given function onto each element of the container. While the trait definition constrains the generic function parameters, F to a FnOnce closure, implementors coulds choose to strengthen this constraint to FnMut or Fn as needed.
MapTo
The MapTo trait defines an interface for containers able to map or apply a given function onto a reference to each of its constituting elements, producing a new container with the results of those function applications. The construction of the trait itself allows implementors to have granular controls over exactly which type of function and output is being produced, relying on associated type parameters to define the container and its current element type.
RawSpace
The RawSpace trait is used to define a base interface for all containers whose elements are of one specific type.
RawSpaceMut
RawSpaceMut is a trait that provides various mutable methods for accessing elements.
RawSpaceRef
RawSpaceRef is a trait that provides various read-only methods for accessing elements.
RawStore
The RawStore trait is a marker trait for key-value store containers.
ScalarSpace
ScalarSpace defins 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.
SliceSpace
SliceSpace is used to define sequential collections, spaces, or containers that can be viewed as slices.
SliceSpaceMut
SliceSpaceMut is used to define sequential collections, spaces, or containers that can be
Store
The Store trait is used to define a key-value store container.
StoreEntry
StoreEntry establishes a common interface for entries within a key-value store.
TryApply
TryApplyMut
TryApplyOnce