pub struct ThemeOverrideProps<'a, T>where
T: ComponentTheme,{
pub children: Vec<AnyElement<'a>>,
pub theme: T,
}Expand description
组件级主题覆盖:向子树注入某个 FooTheme override,只影响该类型组件(解析链第一级)。
手写泛型组件不会从 theme: prop 推断类型,调用时需显式写出主题类型:
element!(ThemeOverride::<BorderTheme>(theme: my_border_theme) { ... })。透明布局节点。
Fields§
§children: Vec<AnyElement<'a>>子元素列表。
theme: T注入的组件主题 override。
Trait Implementations§
Source§impl<T> Default for ThemeOverrideProps<'_, T>where
T: ComponentTheme,
impl<T> Default for ThemeOverrideProps<'_, T>where
T: ComponentTheme,
impl<'a, T> Props for ThemeOverrideProps<'a, T>where
T: ComponentTheme,
Auto Trait Implementations§
impl<'a, T> !RefUnwindSafe for ThemeOverrideProps<'a, T>
impl<'a, T> !Send for ThemeOverrideProps<'a, T>
impl<'a, T> !Sync for ThemeOverrideProps<'a, T>
impl<'a, T> !UnwindSafe for ThemeOverrideProps<'a, T>
impl<'a, T> Freeze for ThemeOverrideProps<'a, T>where
T: Freeze,
impl<'a, T> Unpin for ThemeOverrideProps<'a, T>where
T: Unpin,
impl<'a, T> UnsafeUnpin for ThemeOverrideProps<'a, T>where
T: UnsafeUnpin,
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> 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