Skip to main content

DesktopHost

Struct DesktopHost 

Source
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>

Source

pub fn new(transport: T) -> Self

Starts a desktop host over transport, adopting the desktop preset.

Source

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.

Source

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.

Source

pub fn panes(&self) -> Vec<Symbol>

The panes currently open, in the order they were first opened.

Source

pub fn caps(&self) -> &SurfaceCaps

The desktop’s advertised surface capabilities (the desktop preset).

Source

pub fn transport_mut(&mut self) -> &mut T

Mutable access to the underlying transport, e.g. to drive reconnection.

Auto Trait Implementations§

§

impl<T> Freeze for DesktopHost<T>
where T: Freeze,

§

impl<T> RefUnwindSafe for DesktopHost<T>
where T: RefUnwindSafe,

§

impl<T> Send for DesktopHost<T>
where T: Send,

§

impl<T> Sync for DesktopHost<T>
where T: Sync,

§

impl<T> Unpin for DesktopHost<T>
where T: Unpin,

§

impl<T> UnsafeUnpin for DesktopHost<T>
where T: UnsafeUnpin,

§

impl<T> UnwindSafe for DesktopHost<T>
where T: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.