Expand description
Dispatch for compactable operations:
Compactable and
RefCompactable.
Provides the following dispatch traits and unified free functions:
Each routes to the appropriate trait method based on whether the container is owned or borrowed.
§Examples
use fp_library::{
brands::*,
functions::explicit::*,
};
// compact
let y = compact::<VecBrand, _, _, _>(vec![Some(1), None, Some(3)]);
assert_eq!(y, vec![1, 3]);
// separate
let (errs, oks) = separate::<VecBrand, _, _, _, _>(vec![Ok(1), Err(2), Ok(3)]);
assert_eq!(oks, vec![1, 3]);
assert_eq!(errs, vec![2]);Modules§
- explicit
- Explicit dispatch functions requiring a Brand turbofish.
Traits§
- Compact
Dispatch - Trait that routes a compact operation to the appropriate type class method.
- Separate
Dispatch - Trait that routes a separate operation to the appropriate type class method.