Crate refraction [−] [src]
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 fn
support- More efficient implementation of some macros
To get started easily, import
refraction::prelude::*
.
Modules
conv |
These lenticuloids handle lossless conversions via the standard library
traits |
errors |
These lenticuloids deal with Rust's basic error-handling types: |
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 |
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
AndThenExt |
Extension |
ComposeExt |
Extension |
InvertExt |
Extension |
Iso |
The supertype of all isomorphism families. |
Lens |
The supertype of all lens families. |
Lenticuloid |
The supertype of all lenticuloids. |
PartialLens |
The supertype of all partial lens families. |
Prism |
The supertype of all prism families. |
Functions
identity |
The identity lenticuloid (function form). |
Type Definitions
Injector |