1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
//! Async client for the shep daemon: connect-or-spawn state machine, typed
//! wrappers for every RPC verb, and event-bus subscription streams. This is
//! the programmatic API embedders use; the CLI is a thin consumer of it.
//!
//! Re-exports [`shep_core`] so downstream users need a single dependency.
//!
//! # Quick start
//! ```
//! use shep_client::shep_core::prelude::MemSize;
//!
//! let limit: MemSize = "512M".parse().unwrap();
//! assert_eq!(limit.bytes(), 512 << 20);
//! ```
//!
//! Module-by-module design: `docs/systematic-refactor/refactor-workspace/map.md`.
// The `DogConfig` derive expands to `impl ::shep_client::dogs::DogConfig`,
// which is a path this crate does not otherwise have for itself. `dogs`'s own
// tests derive it, so the name has to resolve from inside. Same reason serde
// does this.
extern crate self as shep_client;
// Portable on both tiers: `connection` names `shep_core::transport::ClientStream`
// rather than `tokio::net::UnixStream` directly, so the OS choice is made one
// crate down and nothing here has a platform arm at all. `spawn`'s exit-code
// contract for a `shep daemon` child reads `ExitStatus::code()`, which every
// platform has.
// The dog side of the probe contract: one call a dog makes as its first line.
// Public because a dog is a third-party binary, so this module IS the API it
// is written against, and it stays a module rather than a flattened re-export
// for the same reason `spawn` does: `dogs::probe` reads as an agreement
// between two processes, which `probe` alone would not.
// `spawn` stays a public module rather than a flattened re-export: the
// exit-code contract (`spawn::DAEMON_ALREADY_RUNNING`) reads better
// qualified, a cross-crate agreement rather than a convenience import.
// Deliberately a plain `//` comment, not `///` — an outer doc comment on a
// `mod` declaration merges with the module file's own `//!` docs and
// resolves in crate-root scope, breaking that module's intra-doc links to
// its own siblings.
pub use ;
pub use ;
pub use ;
/// The trait [`EventStream`] implements.
///
/// Re-exported (IR-32: third-party re-exports normalized under our
/// namespace) because there is no stable `core::stream::Stream` — this
/// trait is otherwise unnameable in a caller's own bound without a direct
/// `futures-util` dependency. Pulling one event at a time needs no import
/// at all: [`EventStream::next`] is an inherent method. Only the trait
/// itself is re-exported, not `StreamExt`'s combinators — the inherent
/// `next` covers the common case, and a narrower surface is easier to widen
/// later than to walk back.
///
/// # Example
///
/// The one thing this re-export is for — writing the bound — with no
/// `futures-util` in the caller's own manifest:
///
/// ```
/// use shep_client::{EventStream, Stream};
///
/// fn _pending_hint<S: Stream>(stream: &S) -> Option<usize> {
/// stream.size_hint().1
/// }
///
/// // And the type that bound exists to accept. A live one comes from
/// // `Client::subscribe`, which needs a daemon; naming it does not.
/// fn _accepts(events: &EventStream) -> Option<usize> {
/// _pending_hint(events)
/// }
/// ```
pub use Stream;
pub use ;
// Portable for the same reason as `connection` above: every fake here binds
// a `shep_core::transport::Listener` rather than a `UnixListener`.
pub use shep_core;
/// The wire protocol this client speaks, re-exported from
/// [`shep_core::protocol::PROTOCOL_VERSION`].
///
/// Here because `docs/dogs.md` asks every dog to print it, and the path
/// through the crate re-export above reads as though a dog is reaching
/// somewhere it should not: `shep_client::shep_core::protocol::PROTOCOL_VERSION`
/// is four segments of plumbing for a number that is part of the dog
/// contract. A dog depends on this crate and on nothing else, so the number
/// it has to publish should be reachable from this crate's own root.
///
/// It is a re-export rather than a copy for the reason the protocol has bitten
/// twice already: the value lives in shep-core, this crate's dependency on it
/// floats within 0.1.x, and a second definition here could disagree with the
/// one the handshake actually compares.
pub use PROTOCOL_VERSION;