pub struct Hook<C>(/* private fields */);Expand description
A hook that can intercept and modify view configurations.
Hooks are used to apply global transformations to views based on their configuration.
Implementations§
Source§impl<C> Hook<C>where
C: ViewConfiguration,
impl<C> Hook<C>where
C: ViewConfiguration,
Sourcepub fn new<V, F>(f: F) -> Hook<C>
pub fn new<V, F>(f: F) -> Hook<C>
Creates a new hook from a function.
The function will be called with the environment and configuration whenever a matching view configuration is encountered.
Sourcepub fn apply(&self, env: &Environment, config: C) -> AnyView
pub fn apply(&self, env: &Environment, config: C) -> AnyView
Applies this hook to a configuration, producing a view.
Trait Implementations§
Auto Trait Implementations§
impl<C> Freeze for Hook<C>
impl<C> !RefUnwindSafe for Hook<C>
impl<C> !Send for Hook<C>
impl<C> !Sync for Hook<C>
impl<C> Unpin for Hook<C>
impl<C> !UnwindSafe for Hook<C>
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more