pub struct RemoteTransport { /* private fields */ }Expand description
A network-backed transport that connects a runtime over realize.
Implementations§
Source§impl RemoteTransport
impl RemoteTransport
Sourcepub fn local_server(endpoint: impl Into<String>) -> Self
pub fn local_server(endpoint: impl Into<String>) -> Self
A local-server transport (HTTP bootstrap + WebSocket live).
Sourcepub fn remote_server(endpoint: impl Into<String>) -> Self
pub fn remote_server(endpoint: impl Into<String>) -> Self
A remote-server transport (HTTP bootstrap + WebSocket live).
Sourcepub fn local_server_address(
endpoint: impl Into<String>,
address: ServerAddress,
) -> Self
pub fn local_server_address( endpoint: impl Into<String>, address: ServerAddress, ) -> Self
A local-server transport targeting an explicit server address.
Sourcepub fn remote_server_address(
endpoint: impl Into<String>,
address: ServerAddress,
) -> Self
pub fn remote_server_address( endpoint: impl Into<String>, address: ServerAddress, ) -> Self
A remote-server transport targeting an explicit server address.
Sourcepub fn address(&self) -> &ServerAddress
pub fn address(&self) -> &ServerAddress
The server address this transport connects to.
Sourcepub fn with_offered_codecs(self, offered_codecs: Vec<Symbol>) -> Self
pub fn with_offered_codecs(self, offered_codecs: Vec<Symbol>) -> Self
Override the codec offer set used during negotiation.
Sourcepub fn with_max_in_flight(self, max_in_flight: usize) -> Self
pub fn with_max_in_flight(self, max_in_flight: usize) -> Self
Override the maximum number of correlated requests allowed in flight.
Sourcepub fn with_timeout(self, timeout: Duration) -> Self
pub fn with_timeout(self, timeout: Duration) -> Self
Override the request timeout used for server answers.
Sourcepub fn connect(&mut self, cx: &mut Cx) -> Result<()>
pub fn connect(&mut self, cx: &mut Cx) -> Result<()>
Request a remote connection and negotiate the server codec.
Sourcepub fn disconnect(&mut self)
pub fn disconnect(&mut self)
Mark the remote channel disconnected.
Sourcepub fn begin_reconnect(&mut self)
pub fn begin_reconnect(&mut self)
Mark the remote channel reconnecting.
Sourcepub fn stream_control_frame(
&self,
cx: &mut Cx,
codec: Symbol,
control: &StreamControl,
) -> Result<ServerFrame>
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
impl Transport for RemoteTransport
Source§fn kind(&self) -> TransportKind
fn kind(&self) -> TransportKind
Which kind of runtime this transport connects to.
Source§fn status(&self) -> SessionStatus
fn status(&self) -> SessionStatus
The current connection status.
Source§fn read(&mut self, cx: &mut Cx, resource: &Symbol) -> Result<Expr>
fn read(&mut self, cx: &mut Cx, resource: &Symbol) -> Result<Expr>
Read the current value of a resource.
Source§fn realize_operation(
&mut self,
cx: &mut Cx,
resource: &Symbol,
operation: &Operation,
) -> Result<Expr>
fn realize_operation( &mut self, cx: &mut Cx, resource: &Symbol, operation: &Operation, ) -> 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 commit_operation(
&mut self,
cx: &mut Cx,
resource: &Symbol,
operation: &Operation,
expected_current: Option<&Expr>,
) -> Result<Expr>
fn commit_operation( &mut self, cx: &mut Cx, resource: &Symbol, operation: &Operation, expected_current: Option<&Expr>, ) -> Result<Expr>
Commit an operation, optionally requiring the resource to still match
expected_current on the server side.Source§fn drain_events(&mut self, cx: &mut Cx) -> Result<Vec<ChangeEvent>>
fn drain_events(&mut self, cx: &mut Cx) -> Result<Vec<ChangeEvent>>
Drain the pending change events (the
realize_events surface).Source§fn stream_subscribe(
&mut self,
_cx: &mut Cx,
stream_id: &Symbol,
) -> Result<StreamInspectorRecord>
fn stream_subscribe( &mut self, _cx: &mut Cx, stream_id: &Symbol, ) -> Result<StreamInspectorRecord>
Subscribe to a stream and return browser-visible inspector data.
Source§fn stream_read(
&mut self,
_cx: &mut Cx,
stream_id: &Symbol,
_limit: usize,
) -> Result<Vec<StreamItem>>
fn stream_read( &mut self, _cx: &mut Cx, stream_id: &Symbol, _limit: usize, ) -> Result<Vec<StreamItem>>
Read at most
limit packets from a stream.Source§fn stream_push(
&mut self,
_cx: &mut Cx,
stream_id: &Symbol,
_envelope: StreamEnvelope,
) -> Result<PushResult>
fn stream_push( &mut self, _cx: &mut Cx, stream_id: &Symbol, _envelope: StreamEnvelope, ) -> Result<PushResult>
Push one stream envelope.
Source§fn stream_stats(
&mut self,
_cx: &mut Cx,
stream_id: &Symbol,
) -> Result<StreamStats>
fn stream_stats( &mut self, _cx: &mut Cx, stream_id: &Symbol, ) -> Result<StreamStats>
Return current stream stats.
Source§fn stream_inspector(
&mut self,
_cx: &mut Cx,
stream_id: &Symbol,
) -> Result<StreamInspectorRecord>
fn stream_inspector( &mut self, _cx: &mut Cx, stream_id: &Symbol, ) -> Result<StreamInspectorRecord>
Return browser-visible inspector data without changing stream state.
Auto Trait Implementations§
impl !RefUnwindSafe for RemoteTransport
impl !UnwindSafe for RemoteTransport
impl Freeze for RemoteTransport
impl Send for RemoteTransport
impl Sync for RemoteTransport
impl Unpin for RemoteTransport
impl UnsafeUnpin for RemoteTransport
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more