summaryrefslogtreecommitdiff
path: root/src/main.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/main.rs')
-rw-r--r--src/main.rs23
1 files changed, 22 insertions, 1 deletions
diff --git a/src/main.rs b/src/main.rs
index e7a11a9..b37873b 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -1,3 +1,24 @@
fn main() {
- println!("Hello, world!");
+ let blobs = Blobs::new(128 * 1024);
+ for blob in blobs.take(10) {
+ println!("{}", blob.len());
+ }
+}
+
+struct Blobs {
+ size: usize,
+}
+
+impl Blobs {
+ fn new(size: usize) -> Self {
+ Self { size }
+ }
+}
+
+impl Iterator for Blobs {
+ type Item = Vec<u8>;
+
+ fn next(&mut self) -> Option<Self::Item> {
+ Some(vec![0; self.size])
+ }
}