Skip to main content

RemoteTransport

Struct RemoteTransport 

Source
pub struct RemoteTransport { /* private fields */ }
Expand description

A network-backed transport that connects a runtime over realize.

Implementations§

Source§

impl RemoteTransport

Source

pub fn wasm() -> Self

A wasm transport targeting an in-browser runtime.

Source

pub fn local_server(endpoint: impl Into<String>) -> Self

A local-server transport (HTTP bootstrap + WebSocket live).

Source

pub fn remote_server(endpoint: impl Into<String>) -> Self

A remote-server transport (HTTP bootstrap + WebSocket live).

Source

pub fn endpoint(&self) -> &str

The configured endpoint.

Source

pub fn connect(&mut self)

Mark the remote channel connected.

Source

pub fn disconnect(&mut self)

Mark the remote channel disconnected.

Source

pub fn begin_reconnect(&mut self)

Mark the remote channel reconnecting.

Source

pub fn stream_control_frame( &self, cx: &mut Cx, codec: Symbol, control: &StreamControl, ) -> Result<ServerFrame>

Encode a stream-fabric control frame for server-backed transports.

Trait Implementations§

Source§

impl Transport for RemoteTransport

Source§

fn kind(&self) -> TransportKind

Which kind of runtime this transport connects to.
Source§

fn status(&self) -> SessionStatus

The current connection status.
Source§

fn read(&self, _resource: &Symbol) -> Result<Expr>

Read the current value of a resource.
Source§

fn realize(&mut self, _resource: &Symbol, _operation: &Expr) -> Result<Expr>

Realize a checked operation against a resource, returning the new value (the realize_final surface). Implementations also record a ChangeEvent for the resource.
Source§

fn drain_events(&mut self) -> Vec<ChangeEvent>

Drain the pending change events (the realize_events surface).
Source§

fn stream_subscribe( &mut self, stream_id: &Symbol, ) -> Result<StreamInspectorRecord>

Subscribe to a stream and return browser-visible inspector data.
Source§

fn stream_read( &mut self, stream_id: &Symbol, _limit: usize, ) -> Result<Vec<StreamItem>>

Read at most limit packets from a stream.
Source§

fn stream_push( &mut self, stream_id: &Symbol, _envelope: StreamEnvelope, ) -> Result<PushResult>

Push one stream envelope.
Source§

fn stream_cancel(&mut self, stream_id: &Symbol) -> Result<()>

Cancel a stream.
Source§

fn stream_stats(&self, stream_id: &Symbol) -> Result<StreamStats>

Return current stream stats.
Source§

fn stream_inspector(&self, stream_id: &Symbol) -> Result<StreamInspectorRecord>

Return browser-visible inspector data without changing stream state.

Auto Trait Implementations§

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.