blueprint_rustls/
position.rs1#[derive(Debug, Default)]
5pub struct TlsPosition {
6 pub in_discard: usize,
8 pub out_send: usize,
10 pub out_encoded: usize,
12 pub want_write_right: bool,
14 pub peer_closed: bool,
16}
17
18impl TlsPosition {
20 pub(crate) fn peer_closed(in_discard: usize) -> Self {
21 Self {
22 in_discard,
23 peer_closed: true,
24 ..Default::default()
25 }
26 }
27 pub(crate) fn with_blocked_handshake(in_discard: usize) -> Self {
28 Self {
29 in_discard,
30 ..Default::default()
31 }
32 }
33 pub(crate) fn with_discard_only(in_discard: usize) -> Self {
34 Self {
35 in_discard,
36 ..Default::default()
37 }
38 }
39 pub(crate) fn with_send(in_discard: usize, out_send: usize) -> Self {
48 Self {
49 in_discard,
50 out_send,
51 ..Default::default()
52 }
53 }
54 pub(crate) fn want_write_right(in_discard: usize) -> Self {
55 Self {
56 in_discard,
57 want_write_right: true,
58 ..Default::default()
59 }
60 }
61}