pub struct Metadata<T: MetadataKey> {
pub content: AnyView,
pub value: T,
}Expand description
Represents a view that carries additional metadata of type T.
This struct allows attaching arbitrary data to a view component. The metadata is expected to be handled by a renderer, and will panic if not properly caught.
Metadata is transparent for layout system, it is not a native view.
Fields§
§content: AnyViewThe view content wrapped by this metadata.
value: TThe metadata value associated with the content.
Implementations§
Trait Implementations§
Auto Trait Implementations§
impl<T> Freeze for Metadata<T>where
T: Freeze,
impl<T> !RefUnwindSafe for Metadata<T>
impl<T> !Send for Metadata<T>
impl<T> !Sync for Metadata<T>
impl<T> Unpin for Metadata<T>where
T: Unpin,
impl<T> !UnwindSafe for Metadata<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