Skip to main content

EducationalOperation

Trait EducationalOperation 

Source
pub trait EducationalOperation {
    type Output;

    // Required methods
    fn execute_with_steps(&self) -> (Self::Output, StepByStepExplanation);
    fn educational_context(&self) -> OperationContext;

    // Provided methods
    fn execute_fast(&self) -> Self::Output { ... }
    fn can_explain(&self) -> bool { ... }
    fn estimated_steps(&self) -> Option<usize> { ... }
}
Expand description

Trait for mathematical operations that provide educational explanations

This trait establishes the architectural pattern for integrating step-by-step educational explanations into mathematical operations. All operations that want to provide educational value should implement this trait.

The trait provides two execution paths:

  1. execute_with_steps - Full educational mode with detailed explanations
  2. execute_fast - Performance-optimized mode without explanation overhead

Required Associated Types§

Source

type Output

The output type of this operation

Required Methods§

Provided Methods§

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§