MCPcopy Create free account
hub / github.com/Rustixir/tokio_sky / fill_buffer

Method fill_buffer

examples/dynamic_batching.rs:86–105  ·  view source on GitHub ↗
(&mut self, buffer_size: usize)

Source from the content-addressed store, hash-verified

84
85
86 async fn fill_buffer(&mut self, buffer_size: usize) -> Result<VecDeque<Product>, Terminate> {
87
88 Ok((0..buffer_size)
89 .into_iter()
90 .map(|i| {
91
92 let ctype = match i {
93 1 | 2 => Category::Cars,
94 3 | 4 => Category::Mobiles,
95 5 => Category::Accessories
96 };
97
98
99 Product {
100 ctype
101 }
102
103 })
104 .collect::<VecDeque<Product>>())
105 }
106}
107
108

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected