pub struct AlgebraicComposer { /* private fields */ }Expand description
Algebraic composition using algebraic data types and pattern matching
Provides algebraic composition patterns with sum types, product types, pattern matching, and algebraic operations for complex composition logic.
Implementations§
Source§impl AlgebraicComposer
impl AlgebraicComposer
Sourcepub fn sum_type<L, R>(self, left: L, right: R) -> Self
pub fn sum_type<L, R>(self, left: L, right: R) -> Self
Add sum type composition (Either/Union types)
Sourcepub fn product_type<T>(self, types: Vec<T>) -> Self
pub fn product_type<T>(self, types: Vec<T>) -> Self
Add product type composition (Tuple/Record types)
Sourcepub fn operation(self, operation: AlgebraicOperation) -> Self
pub fn operation(self, operation: AlgebraicOperation) -> Self
Add algebraic operation
Sourcepub fn build(self) -> AlgebraicComposition
pub fn build(self) -> AlgebraicComposition
Build algebraic composition
Trait Implementations§
Source§impl Debug for AlgebraicComposer
impl Debug for AlgebraicComposer
Auto Trait Implementations§
impl Freeze for AlgebraicComposer
impl !RefUnwindSafe for AlgebraicComposer
impl Send for AlgebraicComposer
impl Sync for AlgebraicComposer
impl Unpin for AlgebraicComposer
impl !UnwindSafe for AlgebraicComposer
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more