pub struct Session<T: Transport> { /* private fields */ }Expand description
A session over a transport, with per-pane subscriptions and an experience mode. The mode is session state (a value); switching it never changes the values being shown.
Implementations§
Source§impl<T: Transport> Session<T>
impl<T: Transport> Session<T>
Sourcepub fn status(&self) -> SessionStatus
pub fn status(&self) -> SessionStatus
The visible connection status.
Sourcepub fn set_mode(&mut self, intent: &Expr) -> Result<()>
pub fn set_mode(&mut self, intent: &Expr) -> Result<()>
Handle an intent/set-mode, switching the session mode. The values being
shown are never read or written.
Sourcepub fn render_universal(&self, value: &Expr) -> Expr
pub fn render_universal(&self, value: &Expr) -> Expr
Render a value through the universal default lens at the session’s mode depth (Household/Builder/Systems show progressively more).
Sourcepub fn transport_mut(&mut self) -> &mut T
pub fn transport_mut(&mut self) -> &mut T
Mutable access to the transport (for example to simulate disconnect in tests, or to drive reconnection).
Sourcepub fn open(
&mut self,
cx: &mut Cx,
registry: &LensRegistry,
pane: Symbol,
resource: Symbol,
view_lens: Symbol,
editor_lens: Symbol,
) -> Result<Expr>
pub fn open( &mut self, cx: &mut Cx, registry: &LensRegistry, pane: Symbol, resource: Symbol, view_lens: Symbol, editor_lens: Symbol, ) -> Result<Expr>
Open resource into pane with the given view and editor lenses; render
and subscribe. Returns the initial Scene.
Sourcepub fn submit_intent(
&mut self,
cx: &mut Cx,
registry: &LensRegistry,
pane: &Symbol,
intent: &Expr,
) -> Result<()>
pub fn submit_intent( &mut self, cx: &mut Cx, registry: &LensRegistry, pane: &Symbol, intent: &Expr, ) -> Result<()>
Submit an Intent against the value shown in pane: decode through the
pane’s editor and commit the operation through realize.
Sourcepub fn pump(
&mut self,
cx: &mut Cx,
registry: &LensRegistry,
) -> Result<Vec<SceneUpdate>>
pub fn pump( &mut self, cx: &mut Cx, registry: &LensRegistry, ) -> Result<Vec<SceneUpdate>>
Drain pending changes and re-render only the affected panes, returning a Scene update (with diff) for each.