We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 56c556d commit ef6d366Copy full SHA for ef6d366
1 file changed
rust/bufferfish-core/src/lib.rs
@@ -239,6 +239,13 @@ impl Bufferfish {
239
self.reading = true;
240
}
241
242
+ /// Clears the buffer and resets the cursor to the start position.
243
+ pub fn clear(&mut self) {
244
+ self.inner.get_mut().clear();
245
+ self.inner.set_position(0);
246
+ self.reading = false;
247
+ }
248
+
249
/// Returns a `Vec<u8>` of the internal byte buffer.
250
pub fn into_vec(self) -> Vec<u8> {
251
self.inner.into_inner()
0 commit comments