MCPcopy Create free account
hub / github.com/RustCrypto/formats / read

Method read

base64ct/src/decoder.rs:254–265  ·  view source on GitHub ↗
(&mut self, buf: &mut [u8])

Source from the content-addressed store, hash-verified

252#[cfg_attr(docsrs, doc(cfg(feature = "std")))]
253impl<'i, E: Encoding> io::Read for Decoder<'i, E> {
254 fn read(&mut self, buf: &mut [u8]) -> io::Result<usize> {
255 if self.is_finished() {
256 return Ok(0);
257 }
258 let slice = match buf.get_mut(..self.remaining_len()) {
259 Some(bytes) => bytes,
260 None => buf,
261 };
262
263 self.decode(slice)?;
264 Ok(slice.len())
265 }
266
267 fn read_to_end(&mut self, buf: &mut Vec<u8>) -> io::Result<usize> {
268 if self.is_finished() {

Callers

nothing calls this directly

Calls 4

is_finishedMethod · 0.45
remaining_lenMethod · 0.45
decodeMethod · 0.45
lenMethod · 0.45

Tested by

no test coverage detected