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_codec(
&mut self,
cx: &mut Cx,
registry: &LensRegistry,
pane: Symbol,
resource: Symbol,
codec: Symbol,
caps: SurfaceCaps,
) -> Result<Expr>
pub fn open_codec( &mut self, cx: &mut Cx, registry: &LensRegistry, pane: Symbol, resource: Symbol, codec: Symbol, caps: SurfaceCaps, ) -> Result<Expr>
Open resource into pane with a canonical reversible surface codec;
render and subscribe. Returns the initial Scene.
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>
Compatibility adapter for callers that still pass split view/editor lens
ids. The bridge session itself stores the canonical
SurfaceCodec id and surface caps.
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 surface codec and commit the operation through realize.
Sourcepub fn submit_intent_at_rendered_revision(
&mut self,
cx: &mut Cx,
registry: &LensRegistry,
pane: &Symbol,
intent: &Expr,
) -> Result<()>
pub fn submit_intent_at_rendered_revision( &mut self, cx: &mut Cx, registry: &LensRegistry, pane: &Symbol, intent: &Expr, ) -> Result<()>
Submit an Intent only if the pane still reflects the value rendered when it was last opened or pumped. This is the optimistic revision path for browser clients that include a rendered frame revision in their request.
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.