pub struct RuntimeSession(/* private fields */);Expand description
An owner for the resources of one UI session.
Implementations§
Source§impl RuntimeSession
impl RuntimeSession
Sourcepub fn state_owner(&self) -> StateOwner
pub fn state_owner(&self) -> StateOwner
Creates a reactive state lifetime owned by this UI session.
Sourcepub fn dispatcher(&self) -> UiDispatcher
pub fn dispatcher(&self) -> UiDispatcher
Captures result delivery to this session’s UI thread.
Sourcepub fn downgrade(&self) -> WeakRuntimeSession
pub fn downgrade(&self) -> WeakRuntimeSession
Returns a reference that does not keep this session alive.
Sourcepub fn resource<T: Default + Send + Sync + 'static>(&self) -> Arc<T> ⓘ
pub fn resource<T: Default + Send + Sync + 'static>(&self) -> Arc<T> ⓘ
Returns a shared resource owned by this session.
Sourcepub fn local_resource<T: Default + 'static>(&self) -> Rc<T>
pub fn local_resource<T: Default + 'static>(&self) -> Rc<T>
Returns a resource that stays on this session’s UI thread.
Sourcepub fn identity(&self) -> RuntimeSessionId
pub fn identity(&self) -> RuntimeSessionId
Returns this session’s identity for correlating observations.
Sourcepub fn run<R>(&self, work: impl FnOnce() -> R) -> R
pub fn run<R>(&self, work: impl FnOnce() -> R) -> R
Runs work with this session’s resources available.
Sourcepub fn enter(&self) -> RuntimeSessionGuard
pub fn enter(&self) -> RuntimeSessionGuard
Selects this session until the returned guard is dropped.
Trait Implementations§
Source§impl Clone for RuntimeSession
impl Clone for RuntimeSession
Source§fn clone(&self) -> RuntimeSession
fn clone(&self) -> RuntimeSession
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Default for RuntimeSession
impl Default for RuntimeSession
Source§impl Drop for RuntimeSession
impl Drop for RuntimeSession
Auto Trait Implementations§
impl !RefUnwindSafe for RuntimeSession
impl !Send for RuntimeSession
impl !Sync for RuntimeSession
impl !UnwindSafe for RuntimeSession
impl Freeze for RuntimeSession
impl Unpin for RuntimeSession
impl UnsafeUnpin for RuntimeSession
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
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Converts
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Converts
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further
downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Converts
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Converts
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
§impl<T> NoneValue for Twhere
T: Default,
impl<T> NoneValue for Twhere
T: Default,
type NoneType = T
§fn null_value() -> T
fn null_value() -> T
The none-equivalent value.