pub struct DesktopHost<T: Transport> { /* private fields */ }Expand description
A desktop host facade: many panes/windows over one Session.
The desktop reuses one session for every open pane, so panes that share a
resource stay coherent for free: an edit submitted on one pane fans out
through Session::pump to every pane subscribed to the same resource.
Implementations§
Source§impl<T: Transport> DesktopHost<T>
impl<T: Transport> DesktopHost<T>
Sourcepub fn new(transport: T) -> Self
pub fn new(transport: T) -> Self
Starts a desktop host over transport, adopting the desktop preset.
Sourcepub fn open_pane(
&mut self,
cx: &mut Cx,
registry: &LensRegistry,
pane: Symbol,
resource: Symbol,
) -> Result<Expr>
pub fn open_pane( &mut self, cx: &mut Cx, registry: &LensRegistry, pane: Symbol, resource: Symbol, ) -> Result<Expr>
Opens resource into the named pane with the universal lenses, tracks
the pane, and returns its initial Scene.
Opening the same resource into several panes subscribes each of them;
re-opening an already-tracked pane re-subscribes it without duplicating
it in DesktopHost::panes.
Sourcepub fn submit(
&mut self,
cx: &mut Cx,
registry: &LensRegistry,
pane: &Symbol,
intent: Expr,
) -> Result<Vec<SceneUpdate>>
pub fn submit( &mut self, cx: &mut Cx, registry: &LensRegistry, pane: &Symbol, intent: Expr, ) -> Result<Vec<SceneUpdate>>
Submits an Intent against pane and pumps.
The returned updates may span several panes when they share the edited resource.
Sourcepub fn panes(&self) -> Vec<Symbol>
pub fn panes(&self) -> Vec<Symbol>
The panes currently open, in the order they were first opened.
Sourcepub fn caps(&self) -> &SurfaceCaps
pub fn caps(&self) -> &SurfaceCaps
The desktop’s advertised surface capabilities (the desktop preset).
Sourcepub fn transport_mut(&mut self) -> &mut T
pub fn transport_mut(&mut self) -> &mut T
Mutable access to the underlying transport, e.g. to drive reconnection.