MCPcopy Index your code
hub / github.com/SoftbearStudios/bitcode / Buffer

Interface Buffer

src/coder.rs:8–22  ·  view source on GitHub ↗

TODO pick different name because it aliases with [`crate::buffer::Buffer`].

Source from the content-addressed store, hash-verified

6
7/// TODO pick different name because it aliases with [`crate::buffer::Buffer`].
8pub trait Buffer {
9 /// Convenience function for `collect_into`.
10 fn collect(&mut self) -> Vec<u8> {
11 let mut vec = vec![];
12 self.collect_into(&mut vec);
13 vec
14 }
15
16 /// Collects the buffer into a single `Vec<u8>`. This clears the buffer.
17 fn collect_into(&mut self, out: &mut Vec<u8>);
18
19 /// Reserves space for `additional` calls to `self.encode()`. Takes a [`NonZeroUsize`] to avoid
20 /// useless calls.
21 fn reserve(&mut self, additional: NonZeroUsize);
22}
23
24/// Iterators passed to [`Encoder::encode_vectored`] must have length <= this.
25pub const MAX_VECTORED_CHUNK: usize = 64;

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
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
variant.rssrc/derive/variant.rs

Calls

no outgoing calls

Tested by

no test coverage detected