pub struct StaticCompositionLocal<T: Clone + 'static> { /* private fields */ }Expand description
A composition local for values that rarely change, as Jetpack Compose’s
staticCompositionLocalOf. A read of .current() subscribes nothing, so
it costs less than a read of a CompositionLocal. In return, a
provider whose value changes recomposes everything it provides to, not
only the readers: every composable call under it runs its body, and
every subcomposition under it composes again the same way.
Implementations§
Source§impl<T: Clone + 'static> StaticCompositionLocal<T>
impl<T: Clone + 'static> StaticCompositionLocal<T>
pub fn provides(&self, value: T) -> ProvidedValue
pub fn current(&self) -> T
pub fn default_value(&self) -> T
Trait Implementations§
impl<T: Clone + 'static> Eq for StaticCompositionLocal<T>
Auto Trait Implementations§
impl<T> !RefUnwindSafe for StaticCompositionLocal<T>
impl<T> !Send for StaticCompositionLocal<T>
impl<T> !Sync for StaticCompositionLocal<T>
impl<T> !UnwindSafe for StaticCompositionLocal<T>
impl<T> Freeze for StaticCompositionLocal<T>
impl<T> Unpin for StaticCompositionLocal<T>
impl<T> UnsafeUnpin for StaticCompositionLocal<T>
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