pub struct Client { /* private fields */ }Expand description
A multiplexed SecretSpec JSON-RPC session.
Implementations§
Source§impl Client
impl Client
Sourcepub async fn connect<R, W, A, B>(
reader: R,
writer: W,
initialize: InitializeParams<A>,
startup_deadline_unix_ms: u64,
) -> Result<(Self, InitializeResult<B>)>where
R: AsyncRead + Unpin + Send + 'static,
W: AsyncWrite + Unpin + Send + 'static,
A: Serialize,
B: DeserializeOwned,
pub async fn connect<R, W, A, B>(
reader: R,
writer: W,
initialize: InitializeParams<A>,
startup_deadline_unix_ms: u64,
) -> Result<(Self, InitializeResult<B>)>where
R: AsyncRead + Unpin + Send + 'static,
W: AsyncWrite + Unpin + Send + 'static,
A: Serialize,
B: DeserializeOwned,
Initialize a session on an already-authenticated private transport.
Sourcepub async fn connect_with_callbacks<R, W, A, B>(
reader: R,
writer: W,
initialize: InitializeParams<A>,
startup_deadline_unix_ms: u64,
callbacks: Option<Arc<dyn CallbackHandler>>,
) -> Result<(Self, InitializeResult<B>)>where
R: AsyncRead + Unpin + Send + 'static,
W: AsyncWrite + Unpin + Send + 'static,
A: Serialize,
B: DeserializeOwned,
pub async fn connect_with_callbacks<R, W, A, B>(
reader: R,
writer: W,
initialize: InitializeParams<A>,
startup_deadline_unix_ms: u64,
callbacks: Option<Arc<dyn CallbackHandler>>,
) -> Result<(Self, InitializeResult<B>)>where
R: AsyncRead + Unpin + Send + 'static,
W: AsyncWrite + Unpin + Send + 'static,
A: Serialize,
B: DeserializeOwned,
As Self::connect, installing a handler for the callbacks this
client advertised in client_methods (0.21+).
Passing None while advertising a callback would leave the server
waiting out its deadline on a request nothing answers, so the two are
checked against each other here rather than at the first callback.
pub async fn start<T: Serialize>( &self, method: &str, params: &T, deadline_unix_ms: u64, ) -> Result<Call>
pub async fn call<P: Serialize, R: DeserializeOwned>( &self, method: &str, params: &P, deadline_unix_ms: u64, ) -> Result<R>
pub async fn limits(&self) -> Limits
pub async fn capabilities(&self) -> HashSet<String>
pub fn is_closed(&self) -> bool
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for Client
impl !UnwindSafe for Client
impl Freeze for Client
impl Send for Client
impl Sync for Client
impl Unpin for Client
impl UnsafeUnpin for Client
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