Skip to main content

Ctx

Struct Ctx 

Source
pub struct Ctx<X> { /* private fields */ }
Expand description

What update may do besides mutating the model: mark views dirty and request effects.

Implementations§

Source§

impl<X> Ctx<X>

Source

pub const fn at(&self) -> u64

Wall clock of the input being handled (ms since epoch, UTC).

Source

pub fn dirty(&mut self, key: impl Into<String>)

Mark a view key as changed; the shell pulls it.

Source

pub fn emit(&mut self, effect: Effect<X>) -> u64

Request an effect. Returns its id; the answer arrives in App::resolve.

Source

pub fn emit_app(&mut self, effect: X) -> u64

Request an app-defined effect.

Trait Implementations§

Source§

impl<X: Debug> Debug for Ctx<X>

Source§

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

Formats the value using the given formatter. Read more
Source§

impl<X> Default for Ctx<X>

Source§

fn default() -> Self

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

Auto Trait Implementations§

§

impl<X> Forget for Ctx<X>

§

impl<X> Freeze for Ctx<X>
where Vec<EffectReq<X>>: Freeze,

§

impl<X> Move for Ctx<X>

§

impl<X> RefUnwindSafe for Ctx<X>

§

impl<X> Send for Ctx<X>
where Vec<EffectReq<X>>: Send,

§

impl<X> Sync for Ctx<X>
where Vec<EffectReq<X>>: Sync,

§

impl<X> Unpin for Ctx<X>
where Vec<EffectReq<X>>: Unpin,

§

impl<X> UnsafeUnpin for Ctx<X>

§

impl<X> UnwindSafe for Ctx<X>

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.