Lines Matching refs:buf
116 pub fn send(&mut self, buf: &[u8]) -> Result<()> { in send()
117 let write_len = self.0.write(buf)?; in send()
124 buf.len(), in send()
128 buf.len(), in send()
155 pub fn recv(&mut self, buf: &mut Vec<u8>) -> Result<()> { in recv()
158 if buf.capacity() == 0 { in recv()
159 buf.reserve(MAX_MESSAGE_SIZE); in recv()
164 buf.resize(buf.capacity(), 0); in recv()
166 match self.0.read(buf.as_mut_slice()) { in recv()
168 buf.truncate(len); in recv()
178 buf.capacity() < MAX_MESSAGE_SIZE, in recv()
185 buf.reserve(MAX_MESSAGE_SIZE - buf.capacity()); in recv()
191 buf.truncate(0); in recv()
218 pub fn recv_no_alloc(&mut self, buf: &mut [u8]) -> Result<usize> { in recv_no_alloc()
219 self.0.read(buf) in recv_no_alloc()