Skip to main content

Runtime

Struct Runtime 

Source
pub struct Runtime { /* private fields */ }
Expand description

Owns one graph and its scheduler. Runtime is intentionally not Clone.

Implementations§

Source§

impl Runtime

Source

pub fn new() -> Self

Source

pub fn with_host(host: Rc<dyn Host>) -> Self

Source

pub fn id(&self) -> RuntimeId

Source

pub fn profile(&self) -> Option<Profile>

Source

pub fn set_profile(&self, profile: Option<Profile>)

Source

pub fn now(&self) -> Option<Duration>

Source

pub fn request_observe(&self) -> bool

Ask the attached event loop for an observation turn. This does not poll tasks or execute application callbacks; host wake must only enqueue.

Source

pub fn owner(&self) -> Owner

Source

pub fn scope(&self) -> Scope

Source

pub fn enter<R>( &self, instance: InstanceId, f: impl FnOnce() -> R, ) -> Result<R, AccessError>

Run a synchronous callback under a live instance’s Owner. This does not retain the instance, borrow the graph during the callback, or flush work. Foreign/stale identities are rejected before calling user code; nested context is restored on return or panic. Future polls need their own entry.

Source

pub fn batch<R>(&self, f: impl FnOnce() -> R) -> Result<R, AccessError>

Values enqueue work. Explicit flush/batch at an event/frame boundary prevents a series of writes from rendering intermediate states.

Source

pub fn flush(&self) -> Result<(), AccessError>

Source

pub fn graph_stats(&self) -> GraphStats

Explicit O(live nodes) diagnostic. Fixed aggregate bins contain no values, identities, visited rows or evaluation history.

Source

pub fn stats(&self) -> RuntimeStats

Trait Implementations§

Source§

impl Default for Runtime

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl Drop for Runtime

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

fn pin_drop(self: Pin<&mut Self>)

🔬This is a nightly-only experimental API. (pin_ergonomics)
Execute the destructor for this type, but different to Drop::drop, it requires self to be pinned. Read more

Auto Trait Implementations§

§

impl !RefUnwindSafe for Runtime

§

impl !Send for Runtime

§

impl !Sync for Runtime

§

impl !UnwindSafe for Runtime

§

impl Forget for Runtime

§

impl Freeze for Runtime
where *const RcInner<RefCell<State>> is !null: Freeze, PhantomData<RcInner<RefCell<State>>>: Freeze,

§

impl Move for Runtime

§

impl Unpin for Runtime
where Rc<RefCell<State>>: Unpin,

§

impl UnsafeUnpin for Runtime
where *const RcInner<RefCell<State>> is !null: UnsafeUnpin, PhantomData<RcInner<RefCell<State>>>: UnsafeUnpin,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.