pub struct CompositionContext {
pub context_id: String,
pub active_pipelines: HashMap<String, Pipeline>,
pub components: HashMap<String, Box<dyn PluggableComponent>>,
pub variables: HashMap<String, Value>,
pub metadata: HashMap<String, String>,
pub state: ContextState,
pub created_at: Instant,
pub last_activity: Instant,
}Expand description
Composition context for execution management
Fields§
§context_id: StringContext identifier
active_pipelines: HashMap<String, Pipeline>Active pipelines
components: HashMap<String, Box<dyn PluggableComponent>>Component instances
variables: HashMap<String, Value>Context variables
metadata: HashMap<String, String>Context metadata
state: ContextStateContext state
created_at: InstantCreation timestamp
last_activity: InstantLast activity timestamp
Implementations§
Source§impl CompositionContext
impl CompositionContext
pub fn new(context_id: &str) -> Self
Sourcepub fn add_component(
&mut self,
component_id: &str,
component: Box<dyn PluggableComponent>,
)
pub fn add_component( &mut self, component_id: &str, component: Box<dyn PluggableComponent>, )
Add a component to the context
Sourcepub fn get_component(
&self,
component_id: &str,
) -> Option<&Box<dyn PluggableComponent>>
pub fn get_component( &self, component_id: &str, ) -> Option<&Box<dyn PluggableComponent>>
Get a component from the context
Sourcepub fn set_variable(&mut self, key: &str, value: Value)
pub fn set_variable(&mut self, key: &str, value: Value)
Set context variable
Sourcepub fn get_variable(&self, key: &str) -> Option<&Value>
pub fn get_variable(&self, key: &str) -> Option<&Value>
Get context variable
Trait Implementations§
Auto Trait Implementations§
impl Freeze for CompositionContext
impl !RefUnwindSafe for CompositionContext
impl Send for CompositionContext
impl Sync for CompositionContext
impl Unpin for CompositionContext
impl !UnwindSafe for CompositionContext
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 more