pub struct Client { /* private fields */ }Expand description
One connection to a running service, past its hello.
Implementations§
Source§impl Client
impl Client
Sourcepub fn connect(socket: &Path, timeout: Duration) -> Result<Self, Ended>
pub fn connect(socket: &Path, timeout: Duration) -> Result<Self, Ended>
Connect to socket and say hello, each step bounded by timeout.
§Errors
Ended::NotAsked naming the cause: hello changes nothing, so any
failure up to its answer leaves nothing asked.
Sourcepub const fn max_frame(&self) -> NonZeroU32
pub const fn max_frame(&self) -> NonZeroU32
The largest frame the service reads or sends.
Sourcepub const fn max_page(&self) -> NonZeroU32
pub const fn max_page(&self) -> NonZeroU32
The most rows the service puts on one page.
Sourcepub fn call(
&mut self,
method: &str,
params: Option<&RawValue>,
) -> Result<Reply, Ended>
pub fn call( &mut self, method: &str, params: Option<&RawValue>, ) -> Result<Reply, Ended>
Send one request and read its reply.
§Errors
Ended::NotAsked for a request larger than the service reads, refused
before sending; Ended::Unknown for any failure from sending onward,
and for a mutation.apply error that is not one of
KNOWN_REFUSALS: those the service sends when the change may already
have been applied (MAY_HAVE_APPLIED), and any code this client does
not know.
Sourcepub fn next_reply(&mut self) -> Result<Reply, Ended>
pub fn next_reply(&mut self) -> Result<Reply, Ended>
Read the next frame of an answer that is a stream, such as
head.follow’s, sent under the same id as its first. A read changes
nothing, so a refusal is a refusal.
§Errors
Ended::Unknown when the frame could not be read: the connection
closed, failed or timed out.