Skip to main content

Module client

Module client 

Source
Expand description

haematite call: ask a running service anything its protocol offers, from the command line; haematite write is in [write] and haematite query in query.

The client says hello first and takes the service’s max_frame as the bound on what it sends and what it reads. Params go out as the text given and a result comes back as the bytes the service sent: no number is parsed into a float and written again. Four outcomes are told apart by exit code: answered (0), could not ask, so nothing was sent (1), refused by the service (2), and outcome not known to the caller (3).

Re-exports§

pub use crate::serve::protocol::NOT_APPLIED_REFUSALS as KNOWN_REFUSALS;

Modules§

query
haematite query: a query’s rows, every page of them, one per line.
write
haematite write: one change to a branch, and always whether it was applied.

Structs§

Client
One connection to a running service, past its hello.
Refusal
A refusal by name, as the service sent it.

Enums§

Ended
Why an exchange gave neither an answer nor a refusal.
Reply
What the service said to one request.

Constants§

MAY_HAVE_APPLIED
Codes which leave the mutation’s outcome uncertain.

Functions§

exit_code
1 when nothing was sent, so asking again is safe; 3 when it may have been.
refused
The standard error line for a refusal.
run
haematite call, ending in its exit code.
words
The standard error line for an exchange that gave no reply.