gpui_router/
layout.rs

1use gpui::{AnyElement, App, Window};
2
3/// A layout that can wrap around routed elements.
4/// Used by [`Router`](crate::Router) to render layouts around matched routes.
5pub trait Layout {
6  /// Sets the outlet element that the layout should render its children into.
7  fn outlet(&mut self, element: AnyElement);
8  /// Renders the layout with the given outlet element.
9  fn render_layout(self: Box<Self>, window: &mut Window, cx: &mut App) -> AnyElement;
10}