pub struct StandaloneHandle<'a> { /* private fields */ }Expand description
A handle passed to the run_with callback each frame, allowing you to
call toast notifications and other runtime APIs from standalone mode.
Implementations§
Source§impl StandaloneHandle<'_>
impl StandaloneHandle<'_>
Sourcepub fn read(&self, id: &str) -> Option<(&UiItem, WidgetState)>
pub fn read(&self, id: &str) -> Option<(&UiItem, WidgetState)>
Returns the item data and its current visual state for any widget by id.
See PaneOverlay::read for details.
Sourcepub fn write(&mut self, id: &str, value: &WriteValue)
pub fn write(&mut self, id: &str, value: &WriteValue)
Set a widget’s value programmatically.
See WriteValue for the supported widget types and their matching variants.
Sourcepub fn create(&mut self, root: &str, builder: impl WidgetBuilder) -> bool
pub fn create(&mut self, root: &str, builder: impl WidgetBuilder) -> bool
Add a code-built widget to a named root. Returns false if the id is already
in use or the root doesn’t exist.
Sourcepub fn destroy(&mut self, id: &str) -> bool
pub fn destroy(&mut self, id: &str) -> bool
Remove a widget by id from any root. Returns true if a widget was removed.
Sourcepub fn create_root(&mut self, name: impl Into<String>)
pub fn create_root(&mut self, name: impl Into<String>)
Create an empty root that can be populated with Self::create.
Sourcepub fn style_id(&self, name: &str) -> Option<StyleId>
pub fn style_id(&self, name: &str) -> Option<StyleId>
Resolve a style name to its StyleId for use with builders.
Sourcepub fn default_style(&self) -> Option<&str>
pub fn default_style(&self) -> Option<&str>
Returns the name of the current default style, if one is set.
Sourcepub fn set_default_style(&mut self, name: &str) -> bool
pub fn set_default_style(&mut self, name: &str) -> bool
Switch the default style by name. Returns false if the name is not registered.
Auto Trait Implementations§
impl<'a> Freeze for StandaloneHandle<'a>
impl<'a> !RefUnwindSafe for StandaloneHandle<'a>
impl<'a> Send for StandaloneHandle<'a>
impl<'a> !Sync for StandaloneHandle<'a>
impl<'a> Unpin for StandaloneHandle<'a>
impl<'a> UnsafeUnpin for StandaloneHandle<'a>
impl<'a> !UnwindSafe for StandaloneHandle<'a>
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
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
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.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more