FullContext

Struct FullContext 

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

Full context - evictable, created by bind operations.

Implementations§

Source§

impl FullContext

Source

pub fn new( start: Tock, end: Tock, values: ValueVec, space: Space, time_taken: Time, replayer: Rc<Replayer>, dependencies: TockVec, ) -> Rc<Self>

Create a new FullContext.

Note: Backedge registration should be done by the caller after creation but before inserting into akasha. This matches the C++ design where backedge registration happens in the constructor (before the context is visible in akasha).

Source

pub fn set_pool_index(&self, idx: usize)

Source

pub fn clear_pool_index(&self)

Source

pub fn pool_index(&self) -> Option<usize>

Source

pub fn time_cost(&self) -> Time

Compute time cost for eviction decision.

Source

pub fn cost(&self, metric: fn(Time, Time, Space) -> Cost) -> Cost

Compute eviction cost using metric function.

Source

pub fn space(&self) -> Space

Source

pub fn dependencies(&self) -> &[Tock]

Source

pub fn time_taken(&self) -> Time

Get the time taken for this computation (used for cost calculation).

Source

pub fn backward_uf(&self) -> &UF

Get the backward UF for this context.

Source

pub fn forward_uf(&self) -> &UF

Get the forward UF for this context.

Trait Implementations§

Source§

impl ContextNode for FullContext

Source§

fn start_tock(&self) -> Tock

Source§

fn end_tock(&self) -> Tock

Source§

fn evictable(&self) -> bool

Source§

fn evict(&self)

Source§

fn evict_at(&self, idx: usize)

Source§

fn accessed(&self)

Source§

fn get_replayer(&self) -> Option<Rc<Replayer>>

Source§

fn get_value_at(&self, idx: usize) -> Option<Rc<dyn EZombieNode>>

Source§

fn as_any(&self) -> &dyn Any

For downcasting to concrete context types.
Source§

fn get_forward_uf(&self) -> Option<UF>

Get forward_uf for backedge registration. Returns None for RootContext.
Source§

impl Debug for FullContext

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

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 = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.