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

Method read

tpm/src/socket.rs:128–139  ·  view source on GitHub ↗
(&mut self, buf: &mut [u8])

Source from the content-addressed store, hash-verified

126 }
127
128 pub fn read(&mut self, buf: &mut [u8]) -> Result<usize> {
129 if self.stream.is_none() {
130 return Err(Error::ReadFromSocket(anyhow!(
131 "Stream for tpm socket was not initialized"
132 )));
133 }
134 let mut socket = self.stream.as_ref().unwrap();
135 let size: usize = socket.read(buf).map_err(|e| {
136 Error::ReadFromSocket(anyhow!("Failed to read from socket. Error Code {e:?}"))
137 })?;
138 Ok(size)
139 }
140}

Callers 15

parse_http_responseFunction · 0.45
create_loop_deviceFunction · 0.45
pty_readFunction · 0.45
set_corrupt_flagFunction · 0.45
_test_pty_interactionFunction · 0.45
_test_ivshmemFunction · 0.45
next_guest_idFunction · 0.45
event_handlerMethod · 0.45
stop_dirty_logMethod · 0.45
start_dirty_logMethod · 0.45
stop_dirty_logMethod · 0.45

Calls

no outgoing calls

Tested by 5

create_loop_deviceFunction · 0.36
pty_readFunction · 0.36
set_corrupt_flagFunction · 0.36
_test_pty_interactionFunction · 0.36
_test_ivshmemFunction · 0.36