@@ -1085,6 +1085,10 @@ impl<'a> IoSliceMut<'a> {
1085
1085
/// Also see [`IoSliceMut::advance_slices`] to advance the cursors of
1086
1086
/// multiple buffers.
1087
1087
///
1088
+ /// # Panics
1089
+ ///
1090
+ /// Panics when trying to advance beyond the end of the slice.
1091
+ ///
1088
1092
/// # Examples
1089
1093
///
1090
1094
/// ```
@@ -1106,15 +1110,18 @@ impl<'a> IoSliceMut<'a> {
1106
1110
self . 0 . advance ( n)
1107
1111
}
1108
1112
1109
- /// Advance the internal cursor of the slices.
1113
+ /// Advance a slice of slices.
1110
1114
///
1111
- /// # Notes
1115
+ /// Shrinks the slice to remove any `IoSliceMut`s that are fully advanced over.
1116
+ /// If the cursor ends up in the middle of an `IoSliceMut`, it is modified
1117
+ /// to start at that cursor.
1118
+ ///
1119
+ /// For example, if we have a slice of two 8-byte `IoSliceMut`s, and we advance by 10 bytes,
1120
+ /// the result will only include the second `IoSliceMut`, advanced by 2 bytes.
1121
+ ///
1122
+ /// # Panics
1112
1123
///
1113
- /// Elements in the slice may be modified if the cursor is not advanced to
1114
- /// the end of the slice. For example if we have a slice of buffers with 2
1115
- /// `IoSliceMut`s, both of length 8, and we advance the cursor by 10 bytes
1116
- /// the first `IoSliceMut` will be untouched however the second will be
1117
- /// modified to remove the first 2 bytes (10 - 8).
1124
+ /// Panics when trying to advance beyond the end of the slices.
1118
1125
///
1119
1126
/// # Examples
1120
1127
///
@@ -1222,6 +1229,10 @@ impl<'a> IoSlice<'a> {
1222
1229
/// Also see [`IoSlice::advance_slices`] to advance the cursors of multiple
1223
1230
/// buffers.
1224
1231
///
1232
+ /// # Panics
1233
+ ///
1234
+ /// Panics when trying to advance beyond the end of the slice.
1235
+ ///
1225
1236
/// # Examples
1226
1237
///
1227
1238
/// ```
@@ -1243,15 +1254,18 @@ impl<'a> IoSlice<'a> {
1243
1254
self . 0 . advance ( n)
1244
1255
}
1245
1256
1246
- /// Advance the internal cursor of the slices.
1257
+ /// Advance a slice of slices.
1247
1258
///
1248
- /// # Notes
1259
+ /// Shrinks the slice to remove any `IoSlice`s that are fully advanced over.
1260
+ /// If the cursor ends up in the middle of an `IoSlice`, it is modified
1261
+ /// to start at that cursor.
1262
+ ///
1263
+ /// For example, if we have a slice of two 8-byte `IoSlice`s, and we advance by 10 bytes,
1264
+ /// the result will only include the second `IoSlice`, advanced by 2 bytes.
1265
+ ///
1266
+ /// # Panics
1249
1267
///
1250
- /// Elements in the slice may be modified if the cursor is not advanced to
1251
- /// the end of the slice. For example if we have a slice of buffers with 2
1252
- /// `IoSlice`s, both of length 8, and we advance the cursor by 10 bytes the
1253
- /// first `IoSlice` will be untouched however the second will be modified to
1254
- /// remove the first 2 bytes (10 - 8).
1268
+ /// Panics when trying to advance beyond the end of the slices.
1255
1269
///
1256
1270
/// # Examples
1257
1271
///
0 commit comments