roopes-core 0.1.1

Roopes is a Rust Object Oriented Pattern Element System. This crate provides generic traits and implementations for typical object-oriented patterns in Rust. It is intended to be used as a cluster of utility classes for implementing OOP-architected executables -- in Rust!
Documentation
//!
#![cfg_attr(feature = "doc-images",
  cfg_attr(
    all(),
    doc = ::embed_doc_image::embed_image!(
        "emitter-diagram",
        "src/primitives/emitter/emitter.svg"
)))]
//! Provides an encapsulated unit of production.
//!
//! ![emitter diagram][emitter-diagram]

pub mod iterator;
pub mod lambda;

pub use iterator::Iterator;
pub use lambda::Lambda;

/// The [`Emitter`] [`Delegate`] must be capable
/// of returning potentially unlimited owned
/// values.
pub trait Delegate<O> = Fn() -> O;

/// [`Emitter`]s are capable of continuously
/// returning an owned object to the
/// caller.  [`Iterator`] is a subset of this
/// interface in that [`Emitter<Option<T>>`] is
/// equivalent to [`Iterator<T>`].
pub trait Emitter<O>
{
    /// Produces a value.
    fn emit(&self) -> O;
}

/// Exposes the [`Emitter`] type at the library
/// level.
pub mod prelude
{
    pub use super::Emitter;
}

#[cfg(test)]
mod tests;