@@ -27,27 +27,27 @@ impl<'a> PacketLine<'a> {
27
27
}
28
28
}
29
29
30
- /// Return this instance as slice if it's [`Data`][Borrowed ::Data].
30
+ /// Return this instance as slice if it's [`Data`][PacketLine ::Data].
31
31
pub fn as_slice ( & self ) -> Option < & [ u8 ] > {
32
32
match self {
33
33
PacketLine :: Data ( d) => Some ( d) ,
34
34
PacketLine :: Flush | PacketLine :: Delimiter | PacketLine :: ResponseEnd => None ,
35
35
}
36
36
}
37
- /// Return this instance's [`as_slice()`][Borrowed ::as_slice()] as [`BStr`].
37
+ /// Return this instance's [`as_slice()`][PacketLine ::as_slice()] as [`BStr`].
38
38
pub fn as_bstr ( & self ) -> Option < & BStr > {
39
39
self . as_slice ( ) . map ( Into :: into)
40
40
}
41
- /// Interpret this instance's [`as_slice()`][Borrowed ::as_slice()] as [`Error`].
41
+ /// Interpret this instance's [`as_slice()`][PacketLine ::as_slice()] as [`Error`].
42
42
///
43
43
/// This works for any data received in an error [channel][crate::Channel].
44
44
///
45
45
/// Note that this creates an unchecked error using the slice verbatim, which is useful to [serialize it][Error::to_write()].
46
- /// See [`check_error()`][Borrowed ::check_error()] for a version that assures the error information is in the expected format.
46
+ /// See [`check_error()`][PacketLine ::check_error()] for a version that assures the error information is in the expected format.
47
47
pub fn to_error ( & self ) -> Option < Error < ' _ > > {
48
48
self . as_slice ( ) . map ( Error )
49
49
}
50
- /// Check this instance's [`as_slice()`][Borrowed ::as_slice()] is a valid [`Error`] and return it.
50
+ /// Check this instance's [`as_slice()`][PacketLine ::as_slice()] is a valid [`Error`] and return it.
51
51
///
52
52
/// This works for any data received in an error [channel][crate::Channel].
53
53
pub fn check_error ( & self ) -> Option < Error < ' _ > > {
@@ -64,10 +64,10 @@ impl<'a> PacketLine<'a> {
64
64
self . as_slice ( ) . map ( Into :: into)
65
65
}
66
66
67
- /// Interpret the data in this [`slice`][Borrowed ::as_slice()] as [`Band`] according to the given `kind` of channel.
67
+ /// Interpret the data in this [`slice`][PacketLine ::as_slice()] as [`Band`] according to the given `kind` of channel.
68
68
///
69
69
/// Note that this is only relevant in a side-band channel.
70
- /// See [`decode_band()`][Borrowed ::decode_band()] in case `kind` is unknown.
70
+ /// See [`decode_band()`][PacketLine ::decode_band()] in case `kind` is unknown.
71
71
pub fn to_band ( & self , kind : Channel ) -> Option < Band < ' _ > > {
72
72
self . as_slice ( ) . map ( |d| match kind {
73
73
Channel :: Data => Band :: Data ( d) ,
@@ -76,7 +76,7 @@ impl<'a> PacketLine<'a> {
76
76
} )
77
77
}
78
78
79
- /// Decode the band of this [`slice`][Borrowed ::as_slice()], or panic if it is not actually a side-band line.
79
+ /// Decode the band of this [`slice`][PacketLine ::as_slice()], or panic if it is not actually a side-band line.
80
80
pub fn decode_band ( & self ) -> Result < Band < ' _ > , DecodeBandError > {
81
81
let d = self . as_slice ( ) . ok_or ( DecodeBandError :: NonDataLine ) ?;
82
82
Ok ( match d[ 0 ] {
@@ -90,7 +90,7 @@ impl<'a> PacketLine<'a> {
90
90
91
91
use quick_error:: quick_error;
92
92
quick_error ! {
93
- /// The error used in [`decode_band()`][Borrowed ::decode_band()].
93
+ /// The error used in [`decode_band()`][PacketLine ::decode_band()].
94
94
#[ derive( Debug ) ]
95
95
#[ allow( missing_docs) ]
96
96
pub enum DecodeBandError {
0 commit comments