/commonlibrary/rust/ylong_http/ylong_http_client/src/sync_impl/ |
H A D | http_body.rs | 126 let mut read = 0; in data() variables 129 // Here cursor read never failed. in data() 130 let this_read = pre.read(buf).unwrap(); in data() 134 read += this_read; in data() 135 let (text, rem) = self.decoder.decode(&buf[..read]); in data() 146 return Ok(read); in data() 153 if !buf[read..].is_empty() { in data() 155 match io.read(&mut buf[read..]) { in data() 165 let (text, rem) = self.decoder.decode(&buf[read in data() 211 let mut read = 0; data() variables [all...] |
H A D | ssl_stream.rs | 31 fn read(&mut self, buf: &mut [u8]) -> std::io::Result<usize> { in read() functions 33 MixStream::Http(s) => s.read(buf), in read() 34 MixStream::Https(s) => s.read(buf), in read()
|
/commonlibrary/rust/ylong_http/ylong_http_client/tests/ |
H A D | sdv_async_http_body_io.rs | 83 let read = resp.body_mut().data(&mut buf).await.unwrap(); in sdv_body_chunk_and_trailer() 84 assert_eq!(read, 5); in sdv_body_chunk_and_trailer() 85 assert_eq!(&buf[..read], b"hello"); in sdv_body_chunk_and_trailer() 86 let read = resp.body_mut().data(&mut buf).await.unwrap(); in sdv_body_chunk_and_trailer() 87 assert_eq!(read, 12); in sdv_body_chunk_and_trailer() 88 assert_eq!(&buf[..read], b"hello world!"); in sdv_body_chunk_and_trailer() 89 let read = resp.body_mut().data(&mut buf).await.unwrap(); in sdv_body_chunk_and_trailer() 90 assert_eq!(read, 0); in sdv_body_chunk_and_trailer() 91 assert_eq!(&buf[..read], b""); in sdv_body_chunk_and_trailer()
|
H A D | sdv_async_http2.rs | 68 panic!("server read request body data occurs error"); 189 let read = response in sdv_async_h2_client_send_request() 193 .expect("Response body read failed"); in sdv_async_h2_client_send_request() 194 if read == 0 { in sdv_async_h2_client_send_request() 197 size += read; in sdv_async_h2_client_send_request() 267 let read = response in sdv_async_h2_client_send_request_concurrently() 271 .expect("Response body read failed"); in sdv_async_h2_client_send_request_concurrently() 272 if read == 0 { in sdv_async_h2_client_send_request_concurrently() 275 size += read; in sdv_async_h2_client_send_request_concurrently()
|
H A D | sdv_async_http_proxy.rs | 114 let read = response in sdv_async_client_send_request() 118 .expect("Response body read failed"); in sdv_async_client_send_request() 119 if read == 0 { in sdv_async_client_send_request() 122 size += read; in sdv_async_client_send_request()
|
/commonlibrary/rust/ylong_runtime/ylong_runtime/benches/bin/ |
H A D | ylong_sync_rwlock_perf.rs | 27 mutex.read().await; in main() 28 mutex.read().await; in main() 29 mutex.read().await; in main() 30 mutex.read().await; in main() 31 mutex.read().await; in main() 34 println!("read : {:?}", end - start); in main()
|
H A D | ylong_tokio_tcp_perf.rs | 48 match client.read(&mut recv_buf).await { in ylong_create_client() 84 match client.read(&mut recv_buf).await { in tokio_create_client() 104 println!("ylong tcp read()+write() Loops: {}", LOOP_NUMS); in main() 120 let _ = match socket.read(&mut buf).await { in main() 142 "ylong tcp read()+write() cost: {:.6} ms", in main() 146 println!("tokio tcp read()+write() Loops: {}", LOOP_NUMS); in main() 164 let _ = match socket.read(&mut buf).await { in main() 186 "tokio tcp read()+write() cost: {:.6} ms", in main()
|
/commonlibrary/rust/ylong_http/ylong_http_client/src/async_impl/ |
H A D | http_body.rs | 84 return err_from_msg!(Request, "Body length is 0 but read extra data"); 172 // If response body is not totally read, shutdown io. in drop() 211 let mut read = 0; in data() variables 213 // Here cursor read never failed. in data() 214 let this_read = Read::read(pre, buf).unwrap(); in data() 218 read += this_read; in data() 222 if !buf[read..].is_empty() { in data() 224 return self.poll_read_io(cx, io, read, buf); in data() 227 Poll::Ready(Ok(read)) in data() 234 read in poll_read_io() 237 let mut read = read; poll_read_io() variables 302 let mut read = 0; data() variables 361 let mut read = read; poll_read_io() variables 444 let mut read = 0; data() variables [all...] |
/commonlibrary/rust/ylong_runtime/ylong_runtime/src/fs/ |
H A D | open_options.rs | 29 /// .read(true) 53 /// let file = options.read(true).open("foo.txt").await; 62 /// Sets the option for file read access. 65 /// `read`-able if opened. 67 /// This method's behavior is the same as [`std::fs::OpenOptions::read`]. 75 /// let file = OpenOptions::new().read(true).open("foo.txt").await; 78 pub fn read(&mut self, read: bool) -> &mut OpenOptions { in read() functions 79 self.0.read(read); in read() [all...] |
/commonlibrary/rust/ylong_runtime/ylong_runtime/src/net/sys/tcp/ |
H A D | stream.rs | 56 /// let _ = stream.read(&mut read_buf).await?; 57 /// let _ = stream.read(&mut read_buf).await?; 159 /// Attempts to read data from the stream to the provided buffer, returning in fmt() 160 /// the number of bytes read. in fmt() 191 .try_io(Interest::READABLE, || (&*self.source).read(buf)) in fmt() 454 /// Splits a TcpStream into a read half and a write half with reference, in fmt() 455 /// which can be used to read and write the stream concurrently. in fmt() 469 /// let (read, write) = stream.split(); in fmt() 474 let read = BorrowReadHalf(self); in fmt() 476 (read, writ in fmt() [all...] |
H A D | split.rs | 23 /// Borrowed read half of a TcpStream 129 /// 3. Split TcpStream into read half and write half with borrowed. in poll_flush() 130 /// 4. Write with write half and read with read half. in poll_flush() 148 let n = read_half.read(&mut buf).await.expect("server read err"); in poll_flush() 152 "hello read half." in poll_flush() 158 let n = stream.read(&mut buf).await.expect("server read err"); in poll_flush() 164 stream.write(b"hello read hal in poll_flush() [all...] |
/commonlibrary/rust/ylong_runtime/ylong_runtime/tests/ |
H A D | async_fs.rs | 27 /// 3. Start another task to read and write the same data as you read. 43 let res = file.read(&mut buf).await.unwrap(); in sdv_async_fs_write() 56 /// 3. Start two tasks to read, write and read the same data. 69 let res = file.read(&mut buf).await.unwrap(); in sdv_async_fs_read() 78 let res = file.read(&mut buf).await.unwrap(); in sdv_async_fs_read() 86 /// SDV test cases for asynchronous file multi-threaded read and write 91 /// 3. Start another task to perform a read operation. 128 let mut ret = file.read( in sdv_async_fs_rw() [all...] |
H A D | async_buf_write.rs | 27 /// 4. Check the read buf. 36 let ret = stream.read(&mut buf).await.unwrap(); in sdv_buf_writer_write() 66 /// 4. Check the read buf. 75 let ret = stream.read(&mut buf).await.unwrap(); in sdv_buf_writer_write_vectored() 105 /// 2. Open the file, seek to three different positions in the file and read 107 /// 3. Check the read buf. 131 let ret = buf_writer.read(&mut buf).await.unwrap(); in sdv_buf_writer_seek() 139 let ret = buf_writer.read(&mut buf).await.unwrap(); in sdv_buf_writer_seek() 146 let ret = buf_writer.read(&mut buf).await.unwrap(); in sdv_buf_writer_seek() 162 /// 4. Check the read bu [all...] |
H A D | async_read.rs | 26 /// 3. call AsyncReadExt::read on them, check the returns are correct. 28 /// 5. call AsyncReadExt::read on them, check the returns are correct. 35 let res = AsyncReadExt::read(&mut slice.as_slice(), &mut buf) in sdv_async_read_slice() 44 let res = AsyncReadExt::read(&mut slice.as_slice(), &mut buf) in sdv_async_read_slice() 60 /// 5. Check the read buf.
|
/commonlibrary/rust/ylong_runtime/ylong_io/src/sys/unix/tcp/ |
H A D | stream.rs | 194 /// Shuts down the read, write, or both halves of this connection. 221 fn read(&mut self, buf: &mut [u8]) -> io::Result<usize> { in read() functions 222 self.inner.read(buf) in read() 245 fn read(&mut self, buf: &mut [u8]) -> io::Result<usize> { in read() functions 247 inner.read(buf) in read()
|
/commonlibrary/rust/ylong_runtime/ylong_io/src/sys/unix/uds/ |
H A D | stream.rs | 163 fn read(&mut self, buf: &mut [u8]) -> io::Result<usize> { in read() functions 164 self.inner.read(buf) in read() 186 fn read(&mut self, buf: &mut [u8]) -> io::Result<usize> { in read() functions 188 inner.read(buf) in read()
|
/commonlibrary/ets_utils/js_util_module/util/ |
H A D | js_textencoder.cpp | 68 napi_value read = nullptr;
in EncodeInto() local 69 NAPI_CALL(env, napi_create_int32(env, nchars, &read));
in EncodeInto() 71 NAPI_CALL(env, napi_set_named_property(env, result, "read", read));
in EncodeInto()
|
/commonlibrary/rust/ylong_runtime/ylong_io/examples/ |
H A D | ylong_io_tcp_client.rs | 36 match stream.read(&mut buffer) { in main() 52 if stream.read(&mut buffer).is_ok() { in main()
|
/commonlibrary/rust/ylong_runtime/ylong_runtime/src/sync/ |
H A D | rwlock.rs | 30 /// Readers are only allowed to read the data, but the writer is the only one 43 /// // Can have multiple read locks at the same time 44 /// let r1 = lock.read().await; 45 /// let r2 = lock.read().await; 93 /// Asynchronously acquires the read lock. 99 /// the read lock concurrently. 110 /// let r1 = lock.read().await; 114 pub async fn read(&self) -> RwLockReadGuard<'_, T> { 123 /// Attempts to get the read lock. If another writer is holding the write 175 // holding a read loc [all...] |
/commonlibrary/rust/ylong_runtime/ylong_runtime/src/process/pty_process/ |
H A D | pty.rs | 82 /// Splits a `Pty` into a read half and a write half with reference, 83 /// which can be used to read and write the stream concurrently. 99 let read = BorrowReadPty(self); in split() 101 (read, write) in split() 104 /// Splits a `Pty` into a read half and a write half, 105 /// which can be used to read and write the stream concurrently. 122 let read = SplitReadPty(Arc::clone(&arc)); in into_split() 124 (read, write) in into_split() 224 /// Borrowed read half of a `Pty`
|
/commonlibrary/rust/ylong_runtime/ylong_runtime/src/process/sys/unix/ |
H A D | pipe.rs | 35 fn read(&mut self, buf: &mut [u8]) -> io::Result<usize> { in read() functions 36 (&self.fd).read(buf) in read() 106 .read(true) in ut_process_pipe_test()
|
/commonlibrary/rust/ylong_runtime/ylong_signal/src/ |
H A D | windows.rs | 62 let race_fallback = sig_map.race_old.read(); 63 let data = sig_map.data.read();
|
/commonlibrary/rust/ylong_http/ylong_http_client/tests/tcp_server/ |
H A D | async_utils.rs | 219 let read = response 221 .expect("Response body read failed"); 222 if read == 0 { 225 size += read;
|
H A D | sync_utils.rs | 208 let read = response 211 .expect("Response body read failed"); 212 if read == 0 { 215 size += read;
|
/commonlibrary/rust/ylong_runtime/ylong_io/tests/ |
H A D | tcp_test.rs | 20 /// SDV for TcpStream read and write 59 let ret = read_stream.read(&mut buf); in sdv_tcp_server() 80 let ret = client.read(&mut buf).unwrap(); in sdv_tcp_server() 154 let ret = client.read(&mut buf).unwrap(); in sdv_tcp_server_vectored()
|