box_closure 0.1.1

Simple closure wrappers with no dependencies
Documentation
//! Wrappers over `Fn`, `FnMut`, and `FnOnce` that simplify dispatching closures when `alloc` isn't available.
//!
//! Typical closures are confusing, `rustc` treats them as unique even if they're identical.
//! The closure types in `box_closure` are only opaque;
//! `rustc` can't see through them and as long as the signitures match,
//! they're treated as being the same closure.
//!
//! This is effectively what `Box<dyn Fn ... >` does, but without allocating a `Box`.
//! For embedded development, heap allocation is not usually an option, so `box_closure`
//! replaces the need to box closures, instead allowing you to wrap them in `OpaqueFn`,
//! `OpaqueFnMut`, or `OpaqueFnOnce` types to stop `rustc` from complaining about opaque types.
//!
//! By being more opaque, `box_closure` stops opaque type compiler errors when dispatching closures.

#![forbid(clippy::all)]
#![forbid(clippy::pedantic)]
#![forbid(clippy::nursery)]
#![forbid(missing_docs)]
#![no_std]

mod internal;

pub use internal::OpaqueFn;
pub use internal::OpaqueFnMut;
pub use internal::OpaqueFnOnce;

pub use internal::{Align1, Align2, Align4, Align8, Align16, Align32, Align64};