pub struct RealityEngine { /* private fields */ }Expand description
Reality engine that coordinates chaos, latency, and MockAI subsystems
This engine applies the appropriate settings to each subsystem based on the current reality level. It acts as a coordinator and doesn’t own the subsystems directly, but provides configuration that can be applied to them.
Implementations§
Source§impl RealityEngine
impl RealityEngine
Sourcepub fn with_level(level: RealityLevel) -> Self
pub fn with_level(level: RealityLevel) -> Self
Create a new reality engine with a specific level
Sourcepub async fn get_level(&self) -> RealityLevel
pub async fn get_level(&self) -> RealityLevel
Get the current reality level
Sourcepub async fn set_level(&self, level: RealityLevel)
pub async fn set_level(&self, level: RealityLevel)
Set the reality level and update configuration
Sourcepub async fn get_config(&self) -> RealityConfig
pub async fn get_config(&self) -> RealityConfig
Get the current reality configuration
Sourcepub async fn get_chaos_config(&self) -> ChaosConfig
pub async fn get_chaos_config(&self) -> ChaosConfig
Get chaos configuration for current level
Sourcepub async fn get_latency_profile(&self) -> LatencyProfile
pub async fn get_latency_profile(&self) -> LatencyProfile
Get latency profile for current level
Sourcepub async fn get_mockai_config(&self) -> IntelligentBehaviorConfig
pub async fn get_mockai_config(&self) -> IntelligentBehaviorConfig
Get MockAI configuration for current level
Sourcepub async fn create_preset(
&self,
name: String,
description: Option<String>,
) -> RealityPreset
pub async fn create_preset( &self, name: String, description: Option<String>, ) -> RealityPreset
Create a preset from current configuration
Sourcepub async fn apply_preset(&self, preset: RealityPreset)
pub async fn apply_preset(&self, preset: RealityPreset)
Apply a preset configuration
Sourcepub async fn apply_to_config(&self, config: &mut ServerConfig)
pub async fn apply_to_config(&self, config: &mut ServerConfig)
Apply reality configuration to a ServerConfig
This method updates the provided ServerConfig with chaos, latency, and MockAI settings from the current reality level. This should be called when initializing the server or when the reality level changes.
Trait Implementations§
Source§impl Clone for RealityEngine
impl Clone for RealityEngine
Source§fn clone(&self) -> RealityEngine
fn clone(&self) -> RealityEngine
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for RealityEngine
impl Debug for RealityEngine
Auto Trait Implementations§
impl Freeze for RealityEngine
impl !RefUnwindSafe for RealityEngine
impl Send for RealityEngine
impl Sync for RealityEngine
impl Unpin for RealityEngine
impl !UnwindSafe for RealityEngine
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
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>
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>
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