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
//! The reply document a reply's frames rebuild. Every [`Wire`](super::Wire)
//! names one [`Reassemble`] type. The driver hands it each frame of a reply
//! whose transport reported no whole document, before the decoder reads the
//! frame, and records what it finishes with as the reply's `raw`. A
//! completion decoder cannot write `raw` itself, so a streamed reply's
//! `raw` has one owner per wire. A wire names a reassembler only for an
//! operation it [`Serves`], and [`Unreassembled`], which records nothing,
//! serves no completion.
//!
//! ```
//! use rig_core::wire::document::{Reassemble, Unreassembled};
//!
//! let mut document = Unreassembled;
//! Reassemble::<String>::absorb(&mut document, &"frame".to_owned());
//! assert!(Reassemble::<String>::finish(document).is_null());
//! ```
use crateWasmCompatSend;
use crate;
/// Rebuilds one reply's provider document from the frames it arrived in.
///
/// A fresh value per reply. `absorb` sees every frame the driver reads, in
/// arrival order, including frames the decoder classifies as unknown or
/// corrupt. `finish` runs once, when the reply ends, fails or is cut
/// short; a reply that did not end yields the document so far.
/// The reassembler of a wire whose decoders record `raw` themselves, which
/// only an operation with [`Free`] events can: it records
/// nothing.
;
/// The operations whose wires may name a reassembler: a wire's
/// [`Reassembler`](super::Wire::Reassembler) must serve its operation.
///
/// [`Unreassembled`] serves only an operation whose decoders record `raw`
/// themselves ([`Free`] events), so a completion wire cannot name it and
/// must name a reassembler that rebuilds its document:
///
/// ```compile_fail,E0271
/// use rig_core::operation::Completion;
/// use rig_core::wire::document::{Serves, Unreassembled};
///
/// fn completion_reassembler<R: Serves<Completion>>() {}
/// completion_reassembler::<Unreassembled>();
/// ```