MCPcopy Create free account
hub / github.com/cloud-hypervisor/cloud-hypervisor / write

Method write

virtio-devices/src/vsock/csm/txbuf.rs:168–175  ·  view source on GitHub ↗
(&mut self, src: &[u8])

Source from the content-addressed store, hash-verified

166
167 impl Write for TestSink {
168 fn write(&mut self, src: &[u8]) -> IoResult<usize> {
169 if self.err.is_some() {
170 return Err(self.err.take().unwrap());
171 }
172 let len_to_push = std::cmp::min(self.capacity - self.data.len(), src.len());
173 self.data.extend_from_slice(&src[..len_to_push]);
174 Ok(len_to_push)
175 }
176 fn flush(&mut self) -> IoResult<()> {
177 Ok(())
178 }

Callers 15

process_rxMethod · 0.45
process_txMethod · 0.45
handle_eventMethod · 0.45
dropMethod · 0.45
test_txq_eventFunction · 0.45
test_rxq_eventFunction · 0.45
test_evq_eventFunction · 0.45
test_backend_eventFunction · 0.45
signal_txq_eventMethod · 0.45
signal_rxq_eventMethod · 0.45
commit_hdrMethod · 0.45
flush_toMethod · 0.45

Calls 2

takeMethod · 0.80
lenMethod · 0.45

Tested by 4

test_txq_eventFunction · 0.36
test_rxq_eventFunction · 0.36
test_evq_eventFunction · 0.36
test_backend_eventFunction · 0.36