pub trait DayImplementation {
type Output<'a>: Display + Eq;
type Context<'a>;
// Required methods
fn day(&self) -> u8;
fn execute_part_1<'a>(
&self,
input: &'a str,
) -> Result<(Self::Output<'a>, Self::Context<'a>)>;
fn execute_part_2<'a>(
&self,
input: &'a str,
context: Self::Context<'a>,
) -> Result<Self::Output<'a>>;
// Provided methods
fn example_input(&self) -> Option<&'static str> { ... }
fn example_part_1_result(&self) -> Option<Self::Output<'static>> { ... }
fn example_part_2_result(&self) -> Option<Self::Output<'static>> { ... }
fn run_with_input<'a>(
&self,
input: &'a str,
) -> Result<ExecutionResult<Self::Output<'a>>> { ... }
}Required Associated Types§
Required Methods§
fn day(&self) -> u8
fn execute_part_1<'a>( &self, input: &'a str, ) -> Result<(Self::Output<'a>, Self::Context<'a>)>
fn execute_part_2<'a>( &self, input: &'a str, context: Self::Context<'a>, ) -> Result<Self::Output<'a>>
Provided Methods§
fn example_input(&self) -> Option<&'static str>
fn example_part_1_result(&self) -> Option<Self::Output<'static>>
fn example_part_2_result(&self) -> Option<Self::Output<'static>>
fn run_with_input<'a>( &self, input: &'a str, ) -> Result<ExecutionResult<Self::Output<'a>>>
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.