pub struct ShellConfig {
pub ui_source: CompiledUiSource,
pub surfaces: Vec<SurfaceComponentConfig>,
}Expand description
Declarative configuration for creating a shell with multiple surfaces
Useful for loading configuration from files or programmatic generation.
Fields§
§ui_source: CompiledUiSource§surfaces: Vec<SurfaceComponentConfig>Implementations§
Source§impl ShellConfig
impl ShellConfig
Sourcepub fn new(ui_source: impl Into<CompiledUiSource>) -> ShellConfig
pub fn new(ui_source: impl Into<CompiledUiSource>) -> ShellConfig
Creates a new shell configuration from a UI source
Sourcepub fn with_surface(self, component: impl Into<String>) -> ShellConfig
pub fn with_surface(self, component: impl Into<String>) -> ShellConfig
Adds a surface with the given component name
Sourcepub fn with_surface_config(
self,
component: impl Into<String>,
config: SurfaceConfig,
) -> ShellConfig
pub fn with_surface_config( self, component: impl Into<String>, config: SurfaceConfig, ) -> ShellConfig
Adds a surface with a complete configuration
Sourcepub fn add_surface(
&mut self,
component: impl Into<String>,
) -> &mut SurfaceComponentConfig
pub fn add_surface( &mut self, component: impl Into<String>, ) -> &mut SurfaceComponentConfig
Adds a surface and returns a mutable reference to it
Sourcepub fn add_surface_config(
&mut self,
component: impl Into<String>,
config: SurfaceConfig,
) -> &mut SurfaceComponentConfig
pub fn add_surface_config( &mut self, component: impl Into<String>, config: SurfaceConfig, ) -> &mut SurfaceComponentConfig
Adds a surface with configuration and returns a mutable reference to it
Trait Implementations§
Source§impl Default for ShellConfig
impl Default for ShellConfig
Source§fn default() -> ShellConfig
fn default() -> ShellConfig
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for ShellConfig
impl !RefUnwindSafe for ShellConfig
impl !Send for ShellConfig
impl !Sync for ShellConfig
impl Unpin for ShellConfig
impl !UnwindSafe for ShellConfig
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
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>
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.Source§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.Source§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.Source§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.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>
Converts
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>
Converts
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