optics/
lib.rs

1#![doc = include_str!("../README.md")]
2#![cfg_attr(not(test), no_std)]
3#![deny(missing_docs)]
4#![warn(clippy::all)]
5#![warn(clippy::pedantic)]
6#![allow(clippy::module_name_repetitions)]
7#![forbid(unsafe_code)]
8
9extern crate alloc;
10
11use core::convert::Infallible;
12
13fn infallible<E>(e: Infallible) -> E {
14    match e {}
15}
16
17mod base;
18mod extensions;
19mod optics;
20
21#[cfg(test)]
22mod test;
23
24pub use base::{HasGetter, HasReverseGet, HasSetter};
25pub use extensions::{HasOver, HasTotalGetter, HasTotalReverseGet};
26
27pub use optics::fallible_iso::{
28    FallibleIso, FallibleIsoImpl, composed_fallible_iso, identity_fallible_iso, mapped_fallible_iso,
29};
30pub use optics::getter::{Getter, GetterImpl, composed_getter, identity_getter, mapped_getter};
31pub use optics::iso::{Iso, IsoImpl, composed_iso, identity_iso, mapped_iso};
32pub use optics::lens::{Lens, LensImpl, composed_lens, identity_lens, mapped_lens};
33pub use optics::partial_getter::{
34    PartialGetter, PartialGetterImpl, composed_partial_getter, identity_partial_getter,
35    mapped_partial_getter,
36};
37pub use optics::prism::{Prism, PrismImpl, composed_prism, identity_prism, mapped_prism};
38pub use optics::setter::{Setter, SetterImpl, composed_setter, identity_setter, mapped_setter};