pub struct HeadlessApp {
pub tree: WidgetTree,
pub theme: Theme,
pub i18n_manager: Option<Rc<I18nManager>>,
pub settings: Option<OpenedSettings>,
}Expand description
A headless app for testing (no window, no GPU).
Fields§
§tree: WidgetTree§theme: Theme§i18n_manager: Option<Rc<I18nManager>>Active i18n manager, if TeksiloAppBuilder::i18n(...) was used. Tests
can reach the bundles, version signal, and locale signal directly
through this handle.
settings: Option<OpenedSettings>Active persistence services, if TeksiloAppBuilder::settings(...)
was used. Held here so the underlying SettingsFile clones
(and their I/O threads) live as long as the headless app.
Implementations§
Source§impl HeadlessApp
impl HeadlessApp
pub fn theme(&self) -> &Theme
Sourcepub fn i18n_manager(&self) -> Option<&Rc<I18nManager>>
pub fn i18n_manager(&self) -> Option<&Rc<I18nManager>>
The active i18n manager, if i18n(...) was registered on the
builder.
Sourcepub fn set_locale(&mut self, locale: LanguageIdentifier)
pub fn set_locale(&mut self, locale: LanguageIdentifier)
Switch the active locale. Updates the manager (which increments the
version signal so any LocalizedString::to_signal() observers
re-resolve), then seeds the tree with the new direction (only when
it actually changed) and triggers a composite rebuild via
WidgetTree::set_locale. No-op if no I18nConfig was registered.
Auto Trait Implementations§
impl !Freeze for HeadlessApp
impl !RefUnwindSafe for HeadlessApp
impl !Send for HeadlessApp
impl !Sync for HeadlessApp
impl !UnwindSafe for HeadlessApp
impl Unpin for HeadlessApp
impl UnsafeUnpin for HeadlessApp
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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.impl<T> ErasedDestructor for Twhere
T: 'static,
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