MCPcopy Create free account
hub / github.com/SoftbearStudios/bitcode / encode_vectored

Method encode_vectored

src/coder.rs:51–58  ·  view source on GitHub ↗

Calls [`Self::encode`] once for every item in `i`. Only use this with **FAST** iterators since the iterator may be iterated multiple times. # Safety Can only encode `self.reserve(additional)` items. `i` must have an accurate `i.size_hint().1.unwrap()` that != 0 and is <= `MAX_VECTORED_CHUNK`. Currently, the non-map iterators that uphold these requirements are: - vec.rs - option.rs

(&mut self, i: impl Iterator<Item = &'a T> + Clone)

Source from the content-addressed store, hash-verified

49 /// - vec.rs
50 /// - option.rs
51 fn encode_vectored<'a>(&mut self, i: impl Iterator<Item = &'a T> + Clone)
52 where
53 T: 'a,
54 {
55 for t in i {
56 self.encode(t);
57 }
58 }
59}
60
61pub trait View<'a> {

Callers

nothing calls this directly

Implementers 15

str.rssrc/str.rs
int.rssrc/int.rs
u8_char.rssrc/u8_char.rs
f32.rssrc/f32.rs
length.rssrc/length.rs
bool.rssrc/bool.rs
arrayvec.rssrc/ext/arrayvec.rs
vec.rssrc/derive/vec.rs
option.rssrc/derive/option.rs
array.rssrc/derive/array.rs
smart_ptr.rssrc/derive/smart_ptr.rs
empty.rssrc/derive/empty.rs

Calls 1

encodeMethod · 0.45

Tested by

no test coverage detected