pub struct ComponentUpdater<'a, 'c: 'a> { /* private fields */ }Implementations§
Source§impl ComponentUpdater<'_, '_>
impl ComponentUpdater<'_, '_>
Sourcepub fn use_palette(&self) -> Palette
pub fn use_palette(&self) -> Palette
手写 Component 在 update 中读取当前 Palette(owned 值,读后即弃守卫)。
Sourcepub fn use_component_theme<T: ComponentTheme>(&self) -> T
pub fn use_component_theme<T: ComponentTheme>(&self) -> T
手写 Component 在 update 中按解析链读取某组件主题(owned 值,读后即弃守卫)。
借用纪律:返回 owned 值后守卫即 drop,可安全继续 update_children。
Source§impl<'a, 'c: 'a> ComponentUpdater<'a, 'c>
impl<'a, 'c: 'a> ComponentUpdater<'a, 'c>
pub fn component_context_stack(&self) -> &ContextStack<'c>
pub fn key(&self) -> &ElementKey
pub fn get_context<T: Any>(&self) -> Option<Ref<'_, T>>
pub fn get_context_mut<T: Any>(&self) -> Option<RefMut<'_, T>>
pub fn terminal(&mut self) -> &mut dyn UpdaterTerminal
pub fn set_transparent_layout(&mut self, transparent: bool)
pub fn set_layout_style(&mut self, layout_style: LayoutStyle)
pub fn update_children<I, T>(
&mut self,
elements: I,
context: Option<Context<'_>>,
)where
I: IntoIterator<Item = T>,
T: ElementRepr,
Auto Trait Implementations§
impl<'a, 'c> !RefUnwindSafe for ComponentUpdater<'a, 'c>
impl<'a, 'c> !Send for ComponentUpdater<'a, 'c>
impl<'a, 'c> !Sync for ComponentUpdater<'a, 'c>
impl<'a, 'c> !UnwindSafe for ComponentUpdater<'a, 'c>
impl<'a, 'c> Freeze for ComponentUpdater<'a, 'c>
impl<'a, 'c> Unpin for ComponentUpdater<'a, 'c>
impl<'a, 'c> UnsafeUnpin for ComponentUpdater<'a, 'c>
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