pub struct Tab<T> {
pub label: TaggedView<T, AnyView>,
pub content: AnyViewBuilder<NavigationView>,
}Expand description
Represents a single tab with a label and content.
The generic parameter T is used for tag identification.
Fields§
§label: TaggedView<T, AnyView>The visual label for the tab, wrapped in a tagged view.
content: AnyViewBuilder<NavigationView>The content to display when this tab is selected.
Returns a NavigationView when given an Environment.
Implementations§
Source§impl<T> Tab<T>
impl<T> Tab<T>
Sourcepub fn new(
label: TaggedView<T, AnyView>,
content: impl ViewBuilder<Output = NavigationView>,
) -> Self
pub fn new( label: TaggedView<T, AnyView>, content: impl ViewBuilder<Output = NavigationView>, ) -> Self
Creates a new tab with the given label and content.
§Arguments
label- The visual representation of the tabcontent- A function that returns the tab’s content as aNavigationView
Trait Implementations§
Auto Trait Implementations§
impl<T> Freeze for Tab<T>where
T: Freeze,
impl<T> !RefUnwindSafe for Tab<T>
impl<T> !Send for Tab<T>
impl<T> !Sync for Tab<T>
impl<T> Unpin for Tab<T>where
T: Unpin,
impl<T> !UnwindSafe for Tab<T>
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