pub struct OperationContext {
pub operation_type: String,
pub difficulty_level: u8,
pub domain: String,
pub prerequisites: Vec<String>,
}Expand description
Context information for educational operations
Provides metadata about the operation being performed, which can be used to generate appropriate educational explanations.
Fields§
§operation_type: StringType of operation (e.g., “solving_equation”, “differentiation”, “simplification”)
difficulty_level: u8Difficulty level (1-10, where 1 is basic and 10 is advanced)
domain: StringMathematical domain (e.g., “algebra”, “calculus”, “linear_algebra”)
prerequisites: Vec<String>Prerequisites required to understand this operation
Implementations§
Source§impl OperationContext
impl OperationContext
Sourcepub fn new<S>(
operation_type: S,
difficulty_level: u8,
domain: S,
) -> OperationContext
pub fn new<S>( operation_type: S, difficulty_level: u8, domain: S, ) -> OperationContext
Create a new operation context
§Arguments
operation_type- Type of mathematical operationdifficulty_level- Difficulty from 1-10domain- Mathematical domain
§Examples
use mathhook_core::educational::traits::OperationContext;
let context = OperationContext::new(
"solving_quadratic",
5,
"algebra"
);
assert_eq!(context.operation_type, "solving_quadratic");
assert_eq!(context.difficulty_level, 5);Sourcepub fn add_prerequisite<S>(&mut self, prerequisite: S)
pub fn add_prerequisite<S>(&mut self, prerequisite: S)
Add a prerequisite to this operation
§Examples
use mathhook_core::educational::traits::OperationContext;
let mut context = OperationContext::new("solving_quadratic", 5, "algebra");
context.add_prerequisite("factoring");
context.add_prerequisite("square_roots");
assert_eq!(context.prerequisites.len(), 2);Sourcepub fn equation_solving(difficulty_level: u8) -> OperationContext
pub fn equation_solving(difficulty_level: u8) -> OperationContext
Create context for equation solving
Sourcepub fn differentiation(difficulty_level: u8) -> OperationContext
pub fn differentiation(difficulty_level: u8) -> OperationContext
Create context for differentiation
Sourcepub fn simplification(difficulty_level: u8) -> OperationContext
pub fn simplification(difficulty_level: u8) -> OperationContext
Create context for simplification
Trait Implementations§
Source§impl Clone for OperationContext
impl Clone for OperationContext
Source§fn clone(&self) -> OperationContext
fn clone(&self) -> OperationContext
Returns a duplicate of the value. Read more
1.0.0§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for OperationContext
impl Debug for OperationContext
Source§impl PartialEq for OperationContext
impl PartialEq for OperationContext
impl StructuralPartialEq for OperationContext
Auto Trait Implementations§
impl Freeze for OperationContext
impl RefUnwindSafe for OperationContext
impl Send for OperationContext
impl Sync for OperationContext
impl Unpin for OperationContext
impl UnwindSafe for OperationContext
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
🔬This is a nightly-only experimental API. (
clone_to_uninit)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