pub struct RealityContinuumEngine { /* private fields */ }Expand description
Reality Continuum Engine
Manages blend ratios for routes, groups, and global settings. Calculates current blend ratios based on transition mode and time.
Implementations§
Source§impl RealityContinuumEngine
impl RealityContinuumEngine
Sourcepub fn new(config: ContinuumConfig) -> Self
pub fn new(config: ContinuumConfig) -> Self
Create a new continuum engine with the given configuration
Sourcepub fn with_virtual_clock(
config: ContinuumConfig,
virtual_clock: Arc<VirtualClock>,
) -> Self
pub fn with_virtual_clock( config: ContinuumConfig, virtual_clock: Arc<VirtualClock>, ) -> Self
Create a new continuum engine with virtual clock integration
Sourcepub fn set_virtual_clock(&mut self, virtual_clock: Arc<VirtualClock>)
pub fn set_virtual_clock(&mut self, virtual_clock: Arc<VirtualClock>)
Set the virtual clock (can be called after construction)
Sourcepub async fn get_blend_ratio(&self, path: &str) -> f64
pub async fn get_blend_ratio(&self, path: &str) -> f64
Get the current blend ratio for a path
Checks in order:
- Manual overrides
- Route-specific rules
- Group-level overrides
- Time-based schedule (if enabled)
- Default ratio
Sourcepub async fn set_blend_ratio(&self, path: &str, ratio: f64)
pub async fn set_blend_ratio(&self, path: &str, ratio: f64)
Set a manual blend ratio override for a path
Sourcepub async fn remove_blend_ratio(&self, path: &str)
pub async fn remove_blend_ratio(&self, path: &str)
Remove a manual blend ratio override
Sourcepub async fn set_group_ratio(&self, group: &str, ratio: f64)
pub async fn set_group_ratio(&self, group: &str, ratio: f64)
Set blend ratio for a group
Sourcepub async fn update_from_time(&self, _time: DateTime<Utc>)
pub async fn update_from_time(&self, _time: DateTime<Utc>)
Update blend ratios based on current time
This should be called periodically when using time-based progression.
Sourcepub fn blender(&self) -> &ResponseBlender
pub fn blender(&self) -> &ResponseBlender
Get the response blender
Sourcepub async fn get_config(&self) -> ContinuumConfig
pub async fn get_config(&self) -> ContinuumConfig
Get the current configuration
Sourcepub async fn update_config(&self, config: ContinuumConfig)
pub async fn update_config(&self, config: ContinuumConfig)
Update the configuration
Sourcepub async fn is_enabled(&self) -> bool
pub async fn is_enabled(&self) -> bool
Check if continuum is enabled
Sourcepub async fn set_enabled(&self, enabled: bool)
pub async fn set_enabled(&self, enabled: bool)
Enable or disable continuum
Sourcepub async fn get_time_schedule(&self) -> Option<TimeSchedule>
pub async fn get_time_schedule(&self) -> Option<TimeSchedule>
Get the time schedule
Sourcepub async fn set_time_schedule(&self, schedule: TimeSchedule)
pub async fn set_time_schedule(&self, schedule: TimeSchedule)
Update the time schedule
Sourcepub async fn advance_ratio(&self, increment: f64)
pub async fn advance_ratio(&self, increment: f64)
Advance the blend ratio manually (for testing/debugging)
This increments the default ratio by a small amount.
Sourcepub async fn get_manual_overrides(&self) -> HashMap<String, f64>
pub async fn get_manual_overrides(&self) -> HashMap<String, f64>
Get all manual overrides
Sourcepub async fn clear_manual_overrides(&self)
pub async fn clear_manual_overrides(&self)
Clear all manual overrides
Trait Implementations§
Source§impl Clone for RealityContinuumEngine
impl Clone for RealityContinuumEngine
Source§fn clone(&self) -> RealityContinuumEngine
fn clone(&self) -> RealityContinuumEngine
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for RealityContinuumEngine
impl Debug for RealityContinuumEngine
Auto Trait Implementations§
impl Freeze for RealityContinuumEngine
impl !RefUnwindSafe for RealityContinuumEngine
impl Send for RealityContinuumEngine
impl Sync for RealityContinuumEngine
impl Unpin for RealityContinuumEngine
impl !UnwindSafe for RealityContinuumEngine
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