pub struct CompositionContext {
pub node_ids: Vec<String>,
pub cell_id: Option<String>,
pub timestamp: SystemTime,
pub node_configs: Vec<NodeConfig>,
}Expand description
Context for rule execution
Provides additional information that rules may need for composition decisions.
Fields§
§node_ids: Vec<String>Node IDs contributing capabilities
cell_id: Option<String>Cell or squad ID if composing within a cell
timestamp: SystemTimeTimestamp of composition (for temporal analysis)
node_configs: Vec<NodeConfig>Node configurations (for operator/authority checks)
Implementations§
Source§impl CompositionContext
impl CompositionContext
Sourcepub fn with_cell_id(self, cell_id: String) -> Self
pub fn with_cell_id(self, cell_id: String) -> Self
Set the cell ID for this composition
Sourcepub fn with_node_configs(self, configs: Vec<NodeConfig>) -> Self
pub fn with_node_configs(self, configs: Vec<NodeConfig>) -> Self
Add node configurations for operator/authority checks
Get the maximum authority level among all operators in the context
Sourcepub fn has_commander(&self) -> bool
pub fn has_commander(&self) -> bool
Check if any node has an operator with Commander authority
Get authorization bonus (0-5 scale) based on max authority
Trait Implementations§
Source§impl Clone for CompositionContext
impl Clone for CompositionContext
Source§fn clone(&self) -> CompositionContext
fn clone(&self) -> CompositionContext
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 CompositionContext
impl Debug for CompositionContext
Auto Trait Implementations§
impl Freeze for CompositionContext
impl RefUnwindSafe for CompositionContext
impl Send for CompositionContext
impl Sync for CompositionContext
impl Unpin for CompositionContext
impl UnsafeUnpin 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> 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