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
RawSpacetrait 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
Applydefines an interface for objects capable of applying the given function onto itself or its elements to produce 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
Iter - The
ContainerItertrait extends theContainertrait to provide an interface for obtaining iterators over the elements of the container. - Container
Map - Functor
- 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. - Functor
Iter - 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- 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. - Slice
Space SliceSpaceis used to define sequential collections, spaces, or containers that can be viewed as slices.- Slice
Space Mut - 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