MCPcopy Create free account
hub / github.com/HFQR/xitca-web / code

Method code

http-encoding/src/lib.rs:46–52  ·  view source on GitHub ↗
(&mut self, item: T)

Source from the content-addressed store, hash-verified

44 type Item = Bytes;
45
46 fn code(&mut self, item: T) -> io::Result<Option<Self::Item>> {
47 let decoder = self.0.as_mut().unwrap();
48 decoder.write_all(item.as_ref())?;
49 decoder.flush()?;
50 let b = decoder.get_mut().take();
51 if !b.is_empty() { Ok(Some(b)) } else { Ok(None) }
52 }
53
54 fn code_eof(&mut self) -> io::Result<Option<Self::Item>> {
55 match self.0.take() {

Callers

nothing calls this directly

Calls 7

as_mutMethod · 0.80
write_allMethod · 0.45
as_refMethod · 0.45
flushMethod · 0.45
takeMethod · 0.45
get_mutMethod · 0.45
is_emptyMethod · 0.45

Tested by

no test coverage detected