Expand description
Modules§
- _private_
phf_ reexport_ for_ macro_ if_ phf_ feature - Rust-PHF is a library to generate efficient lookup tables at compile time using perfect hash functions.
- additional_
attributes - Documentation for Additional Attributes
- buffer
- Buffer-related.
- clone_
dyn - data_
type - Descriptors of primitive data types.
- derive
- Derives.
- error
- Errors handling.
- exposed
- Exposed namespace of the module.
- former
- mem
- Memory-related entities.
- nd
- Multi-dimensional math.
- orphan
- Orphan namespace of the module.
- own
- Own namespace of the module.
- prelude
- Prelude to use essentials:
use my_module::prelude::*
. - thiserror
- github crates-io docs-rs
Macros§
- debug_
assert_ id - Macro asserts that two expressions are identical to each other. Unlike std::assert_eq it is removed from a release build.
- debug_
assert_ identical - Macro asserts that two expressions are identical to each other. Unlike std::assert_eq it is removed from a release build. Alias of debug_assert_id.
- debug_
assert_ ni - Macro asserts that two expressions are not identical to each other. Unlike std::assert_eq it is removed from a release build.
- debug_
assert_ not_ identical - Macro asserts that two expressions are not identical to each other. Unlike std::assert_eq it is removed from a release build.
- err
- Macro to generate an error descriptor.
- from
- Variadic constructor.
- mod_
interface - Protocol of modularity unifying interface of a module and introducing layers.
- return_
err - Macro to return an Err( error ) generating error descriptor.
Structs§
- BTree
MapDefinition - Represents the formation definition for a hash map-like collection within the former framework.
- BTree
MapDefinition Types - Holds the generic parameters for the
BTreeMapDefinition
. - BTree
SetDefinition - Represents the formation definition for a binary tree set-like collection within the former framework.
- BTree
SetDefinition Types - Holds the generic parameters for the
BTreeSetDefinition
. - Basic
Error - baic implementation of generic BasicError
- Binary
Heap Definition - Represents the formation definition for a binary heap-like collection within the former framework.
- Binary
Heap Definition Types - Holds the generic parameters for the
BinaryHeapDefinition
. - Collection
Former - A builder structure for constructing collections with a fluent and flexible interface.
- Forming
EndClosure - A wrapper around a closure to be used as a
FormingEnd
. - Hash
MapDefinition - Represents the formation definition for a hash map-like collection within the former framework.
- Hash
MapDefinition Types - Holds the generic parameters for the
HashMapDefinition
. - Hash
SetDefinition - Represents the formation definition for a hash set-like collection within the former framework.
- Hash
SetDefinition Types - Holds the generic parameters for the
HashSetDefinition
. - Linked
List Definition - Represents the formation definition for a list-like collection within the former framework.
- Linked
List Definition Types - Holds the generic parameters for the
LinkedListDefinition
. - NoEnd
- A placeholder
FormingEnd
used when no end operation is required or applicable. - Return
Preformed - A
FormingEnd
implementation that directly returns the formed collection as the final product of the forming process. - Return
Storage - A
FormingEnd
implementation that returns the storage itself as the formed entity, disregarding any contextual data. - VecDeque
Definition - Represents the formation definition for a vector deque-like collection within the former framework.
- VecDeque
Definition Types - Holds the generic parameters for the
VecDequeDefinition
. - Vector
Data Type - Represents a data type with a specified size.
- Vector
Definition - Represents the formation definition for a vector-like collection within the former framework.
- Vector
Definition Types - Holds the generic parameters for the
VectorDefinition
.
Enums§
- Data
Type - Enum representing basic WebGL data types.
- Parse
Error - The
ParseError
enum is a collection of all the possible reasons an enum can fail to parse from a string.
Traits§
- Add
- The addition operator
+
. - AddAssign
- The addition assignment operator
+=
. - AsBytes
- Trait for converting data to byte slices.
- AsStatic
Ref Deprecated - A cheap reference-to-reference conversion. Used to convert a value to a
reference value with
'static
lifetime within generic code. - Assign
- Provides a generic interface for setting a component of a certain type on an object.
- Assign
With Type - The
AssignWithType
trait provides a mechanism to set a component on an object, utilizing the type information explicitly. This trait extends the functionality ofAssign
by allowing implementers to specify the component’s type at the method call site, enhancing expressiveness in code that manipulates object states. - BTree
MapExt - Provides an extension method for hash maps to facilitate the use of the builder pattern.
- BTree
SetExt - Provides an extension method for binary tree sets to facilitate the use of the builder pattern.
- Binary
Heap Ext - Provides an extension method for binary heaps to facilitate the use of the builder pattern.
- Clone
Dyn - A trait to upcast a clonable entity and clone it. It’s implemented for all entities which can be cloned.
- Collection
- Represents a collection by defining the types of entries and values it handles.
- Collection
Add - Provides functionality to add individual entries to a collection.
- Collection
Assign - Defines the capability to replace all entries in a collection with a new set of entries.
- Collection
ValTo Entry - Provides a mechanism for transforming a value back into a collection-specific entry format.
- Div
- The division operator
/
. - DivAssign
- The division assignment operator
/=
. - Entity
ToDefinition - Maps a type of entity to its corresponding former definition. This trait provides a linkage between the entity and its definition, allowing the formation logic to understand what definition to apply during the formation process.
- Entity
ToDefinition Types - Provides a mapping between a type of entity and its associated formation type definitions.
- Entity
ToFormer - Maps a type of entity to its corresponding former. This trait binds an entity type to a specific former, facilitating the use of custom formers in complex formation scenarios.
- Entity
ToStorage - Maps a type of entity to its storage type. This trait defines what storage structure is used to hold the interim state of an entity during its formation.
- Entry
ToVal - Facilitates the conversion of collection entries to their corresponding value representations.
- Enum
Count - A trait for capturing the number of variants in Enum. This trait can be autoderived by
strum_macros
. - Enum
Message - Associates additional pieces of information with an Enum. This can be
autoimplemented by deriving
EnumMessage
and annotating your variants with#[strum(message="...")]
. - Enum
Property EnumProperty
is a trait that makes it possible to store additional information with enum variants. This trait is designed to be used with the macro of the same name in thestrum_macros
crate. Currently, the only string literals are supported in attributes, the other methods will be implemented as additional attribute types become stabilized.- ErrWith
- This trait allows adding extra context or information to an error, creating a tuple of the additional context and the original error. This is particularly useful for error handling when you want to include more details in the error without losing the original error value.
- Error
Error
is a trait representing the basic expectations for error values, i.e., values of typeE
inResult<T, E>
.- Error
Trait Error
is a trait representing the basic expectations for error values, i.e., values of typeE
inResult<T, E>
.- Former
Begin - A trait for initiating a structured subforming process with contextual and intermediary storage linkage.
- Former
Definition - Expands on
FormerDefinitionTypes
by incorporating an ending mechanism for the formation process. This trait connects the formation types with a specific endpoint, defining how the formation process concludes, including any necessary transformations or validations. - Former
Definition Types - Defines the fundamental components involved in the formation of an entity. This trait specifies the types of storage, the formed entity, and the context used during the formation process.
- Former
Mutator - Provides a mechanism for mutating the context and storage just before the forming process is completed.
- Forming
End - Defines a handler for the end of a subforming process, enabling the return of the original context.
- From1
- Constructor with single argument.
- From2
- Constructor with two arguments.
- From3
- Constructor with three arguments.
- Hash
MapExt - Provides an extension method for hash maps to facilitate the use of the builder pattern.
- Hash
SetExt - Provides an extension method for
HashSet
to facilitate the use of the builder pattern. - Into
- A value-to-value conversion that consumes the input value. The
opposite of
From
. - Into1
- value-to-value conversion that consumes the input value. Change left and rught, but keep semantic of `From1``.
- Into
Enum Iterator - This trait designates that an
Enum
can be iterated over. It can be auto generated usingstrum_macros
on your behalf. - Into
Iterator - Conversion into an
Iterator
. - Into
Vector Data Type - Trait for converting types into
VectorDataType
. - Linked
List Ext - Provides an extension method for lists to facilitate the use of the builder pattern.
- Mul
- The multiplication operator
*
. - MulAssign
- The multiplication assignment operator
*=
. - Option
Ext - Extension trait to provide a method for setting a component on an
Option<Self>
if theOption
is currentlyNone
. If theOption
isSome
, the method will delegate to theAssign
trait’sassign
method. - Pod
- Marker trait for “plain old data”.
- Storage
- Defines the storage interface for entities being constructed using a forming pattern.
- Storage
Preform - Provides a mechanism to finalize the forming process by converting storage into its final formed state.
- Sub
- The subtraction operator
-
. - SubAssign
- The subtraction assignment operator
-=
. - Sum
- Trait to represent types that can be created by summing up an iterator.
- TryInto
- An attempted conversion that consumes
self
, which may or may not be expensive. - ValTo
Entry - Facilitates the conversion of values back into entries for specific collection types.
- Variant
Iterator - Variant
Metadata - Variant
Names - A trait for retrieving the names of each variant in Enum. This trait can
be autoderived by
strum_macros
. - VecDeque
Ext - Provides an extension method for vector deques to facilitate the use of the builder pattern.
- VecExt
- Provides an extension method for vectors to facilitate the use of the builder pattern.
Functions§
- clone
- True clone which is applicable not only to clonable entities, but to trait objects implementing CloneDyn.
- clone_
into_ box - Clone boxed dyn.
Type Aliases§
- BTree
MapFormer - Provides a streamlined builder interface for constructing hash map-like collections.
- BTree
SetFormer - Provides a streamlined builder interface for constructing binary tree set-like collections.
- Binary
Heap Former - Provides a streamlined builder interface for constructing binary heap-like collections.
- Hash
MapFormer - Provides a streamlined builder interface for constructing hash map-like collections.
- Hash
SetFormer - Provides a concise alias for
CollectionFormer
configured specifically forHashSet
-like collections. - Linked
List Former - Provides a streamlined builder interface for constructing list-like collections.
- Result
With Report - A type alias for a
Result
that contains an error which is a tuple of a report and an original error. - VecDeque
Former - Provides a streamlined builder interface for constructing vector deque-like collections.
- Vector
Former - Provides a streamlined builder interface for constructing vector-like collections.
Attribute Macros§
- clone_
dyn - Derive macro to generate former for a structure. Former is variation of Builder Pattern.
- phantom
- Provides an automatic
PhantomData
field for a struct based on its generic types.
Derive Macros§
- Add
- What
#[derive(Add)]
generates - AddAssign
- What
#[derive(AddAssign)]
generates - AsMut
- Derive macro to implement AsMut when-ever it’s possible to do automatically.
- AsRef
- Derive macro to implement AsRef when-ever it’s possible to do automatically.
- AsRef
Str - Converts enum variants to
&'static str
. - AsStatic
Str - Assign
- Derives the
Assign
trait for struct fields, allowing each field to be set with a value that can be converted into the field’s type. - Component
From - Macro to implement
From
for each component (field) of a structure. This macro simplifies the creation ofFrom
trait implementations for struct fields, enabling easy conversion from a struct reference to its field types. - Components
Assign - Derives the
ComponentsAssign
trait for a struct, enablingcomponents_assign
which set all fields at once. - Constructor
- What
#[derive(Constructor)]
generates - Deref
- Derive macro to implement Deref when-ever it’s possible to do automatically.
- Deref
Mut - Derive macro to implement Deref when-ever it’s possible to do automatically.
- Display
- Div
- What
#[derive(Mul)]
generates - DivAssign
- What
#[derive(MulAssign)]
generates - Enum
Count - Add a constant
usize
equal to the number of variants. - Enum
Discriminants - Generate a new type with only the discriminant names.
- EnumIs
- Generated
is_*()
methods for each variant. E.g.Color.is_red()
. - Enum
Iter - Creates a new type that iterates of the variants of an enum.
- Enum
Message - Add a verbose message to an enum variant.
- Enum
Property - Add custom properties to enum variants.
- Enum
String - Converts strings to enum variants based on their name.
- Enum
TryAs - Generated
try_as_*()
methods for all tuple-style variants. E.g.Message.try_as_write()
. - Enum
Variant Names - Implements
Strum::VariantNames
which adds an associated constantVARIANTS
which is an array of discriminant names. - Error
- Using
#[derive(Error)]
- Former
- Derive macro for generating a
Former
struct, applying a Builder Pattern to the annotated struct. - From
- Provides an automatic
From
implementation for struct wrapping a single value. - From
Components - A procedural macro to automatically derive the
From<T>
trait implementation for a struct, enabling instances of one type to be converted from instances of another type. - From
Repr - Add a function to enum that allows accessing variants by its discriminant
- FromStr
- Index
- Provides an automatic Index trait implementation when-ever it’s possible.
- Index
Mut - Provides an automatic IndexMut trait implementation when-ever it’s possible.
- Inner
From - Derive macro to implement From converting outer type into inner when-ever it’s possible to do automatically.
- Into
- What
#[derive(Into)]
generates - Into
Iterator - Using
#[derive(IntoIterator)]
- Into
Static Str - Implements
From<MyEnum> for &'static str
on an enum. - IsVariant
- What
#[derive(IsVariant)]
generates - Mul
- What
#[derive(Mul)]
generates - MulAssign
- What
#[derive(MulAssign)]
generates - New
- Provides an automatic
new
implementation for struct wrapping a single value. - Not
- Provides an automatic Not trait implementation for struct.
- Pod
- Derive the
Pod
trait for a struct - Sub
- What
#[derive(Add)]
generates - SubAssign
- What
#[derive(AddAssign)]
generates - Sum
- Using
#[derive(Sum)]
- ToString
- implements
std::string::ToString
on an enum - TryInto
- What
#[derive(TryInto)]
generates - Unwrap
- What
#[derive(Unwrap)]
generates - Variadic
From - The
derive_variadic_from
macro is designed to provide a way to implement theFrom
-like traits for structs with a variable number of fields, allowing them to be constructed from tuples of different lengths or from individual arguments. This functionality is particularly useful for creating flexible constructors that enable different methods of instantiation for a struct. By automating the implementation of traits, this macro reduces boilerplate code and enhances code readability and maintainability.