Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "linkedbytes"
version = "0.1.8"
version = "0.1.9"
authors = ["Volo Team <volo@cloudwego.io>"]
edition = "2021"
description = "LinkedBytes is a linked list of Bytes and BytesMut."
Expand Down
10 changes: 10 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -298,6 +298,16 @@ impl LinkedBytes {
pub fn iter_list(&self) -> impl Iterator<Item = &Node> {
self.list.iter()
}

/// This converts the list to an iterator.
/// This is an unstable API that may change in the future, don't rely on this.
#[doc(hidden)]
#[inline]
pub fn into_iter_list(mut self) -> impl Iterator<Item = Node> {
let node = Node::BytesMut(self.bytes);
self.list.push_back(node);
self.list.into_iter()
}
}

impl Default for LinkedBytes {
Expand Down
Loading