pub trait DataActorNative {
// Required methods
fn core(&self) -> &DataActorCore;
fn core_mut(&mut self) -> &mut DataActorCore;
// Provided methods
fn clock_mut(&mut self) -> RefMut<'_, dyn Clock> { ... }
fn clock_rc(&self) -> Rc<RefCell<dyn Clock>> { ... }
fn cache_ref(&self) -> Ref<'_, Cache> { ... }
fn cache_rc(&self) -> Rc<RefCell<Cache>> { ... }
}Expand description
Explicit native-only access for data actor runtime state.
Normal actor and strategy code should use facade methods such as
DataActor::clock and DataActor::cache. Import this trait only from
Rust code compiled into the same native binary as the engine, when a
performance-sensitive path or host integration needs access below the facade
API.
Do not import this trait in strategy code intended to run through Python or
the plug-in authoring surface. Native borrows, Rc<RefCell<_>>, and core
references do not cross those boundaries.
Required Methods§
Sourcefn core(&self) -> &DataActorCore
fn core(&self) -> &DataActorCore
Returns the actor core.
Sourcefn core_mut(&mut self) -> &mut DataActorCore
fn core_mut(&mut self) -> &mut DataActorCore
Returns the mutable actor core.
Provided Methods§
Sourcefn clock_mut(&mut self) -> RefMut<'_, dyn Clock>
fn clock_mut(&mut self) -> RefMut<'_, dyn Clock>
Returns the mutable clock borrow for the actor.
§Panics
Panics if the actor has not been registered with a trader.
Sourcefn clock_rc(&self) -> Rc<RefCell<dyn Clock>>
fn clock_rc(&self) -> Rc<RefCell<dyn Clock>>
Returns a clone of the reference-counted clock.
§Panics
Panics if the actor has not yet been registered.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".