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
use core::ops::{BitOr, BitOrAssign};
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
pub enum AckElicitation {
NonEliciting,
Eliciting,
}
impl Default for AckElicitation {
fn default() -> Self {
Self::NonEliciting
}
}
impl AckElicitation {
pub fn is_ack_eliciting(self) -> bool {
matches!(self, Self::Eliciting)
}
}
impl BitOr<AckElicitation> for AckElicitation {
type Output = Self;
fn bitor(self, rhs: Self) -> Self {
match (self, rhs) {
(Self::Eliciting, _) => Self::Eliciting,
(_, Self::Eliciting) => Self::Eliciting,
(_, _) => Self::NonEliciting,
}
}
}
impl BitOrAssign<AckElicitation> for AckElicitation {
fn bitor_assign(&mut self, rhs: Self) {
*self = *self | rhs;
}
}
pub trait AckElicitable {
#[inline]
fn ack_elicitation(&self) -> AckElicitation {
AckElicitation::Eliciting
}
}
impl<AckRanges> AckElicitable for crate::frame::Ack<AckRanges> {
#[inline]
fn ack_elicitation(&self) -> AckElicitation {
AckElicitation::NonEliciting
}
}
impl AckElicitable for crate::frame::ConnectionClose<'_> {
#[inline]
fn ack_elicitation(&self) -> AckElicitation {
AckElicitation::NonEliciting
}
}
impl<Data> AckElicitable for crate::frame::Crypto<Data> {}
impl<Data> AckElicitable for crate::frame::Datagram<Data> {}
impl AckElicitable for crate::frame::DataBlocked {}
impl AckElicitable for crate::frame::HandshakeDone {}
impl AckElicitable for crate::frame::MaxData {}
impl AckElicitable for crate::frame::MaxStreamData {}
impl AckElicitable for crate::frame::MaxStreams {}
impl AckElicitable for crate::frame::NewConnectionId<'_> {}
impl AckElicitable for crate::frame::NewToken<'_> {}
impl AckElicitable for crate::frame::Padding {
#[inline]
fn ack_elicitation(&self) -> AckElicitation {
AckElicitation::NonEliciting
}
}
impl AckElicitable for crate::frame::PathChallenge<'_> {}
impl AckElicitable for crate::frame::PathResponse<'_> {}
impl AckElicitable for crate::frame::Ping {}
impl AckElicitable for crate::frame::ResetStream {}
impl AckElicitable for crate::frame::RetireConnectionId {}
impl AckElicitable for crate::frame::StopSending {}
impl<Data> AckElicitable for crate::frame::Stream<Data> {}
impl AckElicitable for crate::frame::StreamDataBlocked {}
impl AckElicitable for crate::frame::StreamsBlocked {}