pub struct AppServerRpc { /* private fields */ }Expand description
Initialized app-server connection.
Implementations§
Source§impl AppServerRpc
impl AppServerRpc
Sourcepub async fn connect<R, W>(
reader: R,
writer: W,
config: RpcConfig,
) -> Result<Arc<Self>, BridgeError>
pub async fn connect<R, W>( reader: R, writer: W, config: RpcConfig, ) -> Result<Arc<Self>, BridgeError>
Connects to app-server and completes initialize/initialized exactly once.
Sourcepub fn subscribe(&self) -> Receiver<RpcNotification>
pub fn subscribe(&self) -> Receiver<RpcNotification>
Subscribes before starting a turn so no notification is missed.
Sourcepub async fn request(
&self,
method: &str,
params: Value,
) -> Result<Value, BridgeError>
pub async fn request( &self, method: &str, params: Value, ) -> Result<Value, BridgeError>
Sends a request using the default timeout.
Sourcepub async fn request_until(
&self,
method: &str,
params: Value,
deadline: Instant,
cancellation: CancellationToken,
) -> Result<Value, BridgeError>
pub async fn request_until( &self, method: &str, params: Value, deadline: Instant, cancellation: CancellationToken, ) -> Result<Value, BridgeError>
Sends a request bounded by an absolute deadline and cancellation token.
Sourcepub async fn request_side_effecting_until(
&self,
method: &str,
params: Value,
deadline: Instant,
cancellation: CancellationToken,
) -> Result<Value, BridgeError>
pub async fn request_side_effecting_until( &self, method: &str, params: Value, deadline: Instant, cancellation: CancellationToken, ) -> Result<Value, BridgeError>
Sends a side-effecting request and marks post-flush ambiguity explicitly.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for AppServerRpc
impl !RefUnwindSafe for AppServerRpc
impl !UnwindSafe for AppServerRpc
impl Send for AppServerRpc
impl Sync for AppServerRpc
impl Unpin for AppServerRpc
impl UnsafeUnpin for AppServerRpc
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