pub struct ContextMap { /* private fields */ }Expand description
Maps streams/connectors to their assigned context.
Built during Engine::load() by processing ContextDecl statements
and StreamOp::Context / Emit { target_context } operations.
Implementations§
Source§impl ContextMap
impl ContextMap
pub fn new() -> Self
Sourcepub fn register_context(&mut self, config: ContextConfig)
pub fn register_context(&mut self, config: ContextConfig)
Register a context declaration
Sourcepub fn assign_stream(&mut self, stream_name: String, context_name: String)
pub fn assign_stream(&mut self, stream_name: String, context_name: String)
Assign a stream to a context
Sourcepub fn add_cross_context_emit(
&mut self,
stream_name: String,
emit_index: usize,
target_context: String,
)
pub fn add_cross_context_emit( &mut self, stream_name: String, emit_index: usize, target_context: String, )
Record a cross-context emit
Sourcepub fn has_contexts(&self) -> bool
pub fn has_contexts(&self) -> bool
Check if any contexts have been declared
Sourcepub const fn contexts(&self) -> &HashMap<String, ContextConfig>
pub const fn contexts(&self) -> &HashMap<String, ContextConfig>
Get all declared contexts
Sourcepub fn stream_context(&self, stream_name: &str) -> Option<&str>
pub fn stream_context(&self, stream_name: &str) -> Option<&str>
Get the context assignment for a stream
Sourcepub const fn stream_assignments(&self) -> &HashMap<String, String>
pub const fn stream_assignments(&self) -> &HashMap<String, String>
Get all stream assignments
Trait Implementations§
Source§impl Clone for ContextMap
impl Clone for ContextMap
Source§fn clone(&self) -> ContextMap
fn clone(&self) -> ContextMap
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ContextMap
impl Debug for ContextMap
Source§impl Default for ContextMap
impl Default for ContextMap
Source§fn default() -> ContextMap
fn default() -> ContextMap
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for ContextMap
impl RefUnwindSafe for ContextMap
impl Send for ContextMap
impl Sync for ContextMap
impl Unpin for ContextMap
impl UnsafeUnpin for ContextMap
impl UnwindSafe for ContextMap
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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