pub struct MacroExecutionContext {
pub resource_usage: Arc<Mutex<ResourceUsage>>,
pub start_time: Instant,
pub errors: Arc<Mutex<Vec<DSLError>>>,
pub warnings: Arc<Mutex<Vec<DSLWarning>>>,
pub metrics: Arc<Mutex<PerformanceMetrics>>,
pub config: ResourceConfig,
}Expand description
Macro execution context for maintaining state during DSL processing
Provides a context for macro execution that includes resource management, error tracking, and performance monitoring.
Fields§
§resource_usage: Arc<Mutex<ResourceUsage>>Current resource usage
start_time: InstantCompilation start time
errors: Arc<Mutex<Vec<DSLError>>>Errors encountered during execution
warnings: Arc<Mutex<Vec<DSLWarning>>>Warnings generated during execution
metrics: Arc<Mutex<PerformanceMetrics>>Performance metrics
config: ResourceConfigConfiguration for this execution
Implementations§
Source§impl MacroExecutionContext
impl MacroExecutionContext
Sourcepub fn new(config: ResourceConfig) -> MacroExecutionContext
pub fn new(config: ResourceConfig) -> MacroExecutionContext
Create a new macro execution context
Sourcepub fn add_warning(&self, warning: DSLWarning)
pub fn add_warning(&self, warning: DSLWarning)
Record a warning in the execution context
Sourcepub fn update_metrics<F>(&self, updater: F)where
F: FnOnce(&mut PerformanceMetrics),
pub fn update_metrics<F>(&self, updater: F)where
F: FnOnce(&mut PerformanceMetrics),
Update performance metrics
Sourcepub fn elapsed_time(&self) -> Duration
pub fn elapsed_time(&self) -> Duration
Get current execution duration
Sourcepub fn is_timed_out(&self) -> bool
pub fn is_timed_out(&self) -> bool
Check if execution has timed out
Sourcepub fn get_summary(&self) -> ExecutionSummary
pub fn get_summary(&self) -> ExecutionSummary
Get execution summary
Trait Implementations§
Auto Trait Implementations§
impl Freeze for MacroExecutionContext
impl RefUnwindSafe for MacroExecutionContext
impl Send for MacroExecutionContext
impl Sync for MacroExecutionContext
impl Unpin for MacroExecutionContext
impl UnsafeUnpin for MacroExecutionContext
impl UnwindSafe for MacroExecutionContext
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.