Expand description
refraction is a lens library for Rust. Its design is based broadly on
that of the Haskell lens
package, but reworked and
reorganized to become more Rusty.
The nightly cargo feature flag can be used to enable some features only
available on nightly Rust:
- Lenticuloids that deal with the
!type const fnsupport- More efficient implementation of some macros
To get started easily, import
refraction::prelude::*.
Modules§
- access
- collections
- conv
- These lenticuloids handle lossless conversions via the standard library
traits
Into,AsRefandAsMut. - errors
- These lenticuloids deal with Rust’s basic error-handling types:
OptionandResult. - meta
- prelude
- A prelude module suitible for glob-importing.
- terminal
- These lenticuloids deal with the trivial and the impossible; that is, they
operate with values of types
()and!(the latter only on nightly Rust, with thenightlyfeature flag enabled). - util
- Some utility functions used inside this crate, but possibly useful for others as well.
Macros§
- chain_
and_ then - Compose all the provided lenticuloids in intuitive order.
- chain_
compose - Compose all the provided lenticuloids in categorical order.
- field_
lens - Create a simple lens inline to address a specific (possibly nested) field of a type.
Structs§
- Compose
- Composition of lenticuloids.
- Identity
- The identity lenticuloid.
- Invert
- The inversion of a lenticuloid.
Traits§
- AndThen
Ext - Extension
traitfor lenticuloid composition in intuitive order. - Compose
Ext - Extension
traitfor lenticuloid composition in categorical order. - Invert
Ext - Extension
traitfor lenticuloid inversion. - Iso
- The supertype of all isomorphism families.
- Lens
- The supertype of all lens families.
- Lenticuloid
- The supertype of all lenticuloids.
- Partial
Lens - The supertype of all partial lens families.
- Prism
- The supertype of all prism families.
Functions§
- identity
- The identity lenticuloid (function form).