eryon-core 0.0.4

The core modules of the eryon framework, providing essential functionality for computational entities.
/*
    Appellation: transform <module>
    Contrib: @FL03
*/

/// The [`TransformOnce`] trait generically defines a consuming operation that transforms one
/// value into another based on some given.
pub trait TransformOnce<Rhs> {
    type Output;

    fn transform(self, rhs: Rhs) -> Self::Output;
}
/// The [`TransformMut`] trait extends the [`TransformOnce`] trait to define a mutable
/// transformation operation.
pub trait TransformMut<Rhs>: TransformOnce<Rhs> {
    fn transform(&mut self, rhs: Rhs) -> Self::Output;
}

/// The [`Transform`] trait defines an owned transformation operation.
pub trait Transform<Rhs>: TransformOnce<Rhs> {
    fn transform(&self, rhs: Rhs) -> Self::Output;
}