/commonlibrary/rust/ylong_runtime/ylong_runtime/src/net/ |
H A D | async_source.rs | 15 use std::io; 16 use std::io::{Read, Write}; 27 use crate::io::{poll_ready, ReadBuf}; 31 /// Wrapper that turns a sync `Source` io into an async one. This struct 34 /// Sync io that implements `Source` trait. 35 io: Option<E>, 47 pub fn fchown(&self, uid: uid_t, gid: gid_t) -> io::Result<()> { in fchown() 63 pub fn new(mut io: E, interest: Option<Interest>) -> io::Result<AsyncSource<E>> { in new() 67 let entry = inner.io_register(&mut io, interes in new() 98 let mut io = self.io.take().unwrap(); global() variables [all...] |
/commonlibrary/rust/ylong_runtime/ylong_io/src/sys/unix/udp/ |
H A D | udp_socket.rs | 16 use std::os::unix::io::AsRawFd; 17 use std::{fmt, io, net}; 29 /// use std::io; 33 /// async fn io_func() -> io::Result<()> { 71 /// return io::Error if errors happen. 76 /// use std::io; 80 /// async fn io_func() -> io::Result<()> { 88 pub fn bind(addr: SocketAddr) -> io::Result<UdpSocket> { in bind() 96 /// standard library in the io equivalent. The conversion assumes nothing 108 /// use std::io; [all...] |
/commonlibrary/rust/ylong_runtime/ylong_io/src/sys/windows/udp/ |
H A D | udp_socket.rs | 16 use std::os::windows::io::{AsRawSocket, RawSocket}; 17 use std::{fmt, io, net}; 42 pub fn bind(addr: SocketAddr) -> io::Result<UdpSocket> { in bind() 62 pub fn connect(self, addr: SocketAddr) -> io::Result<ConnectedUdpSocket> { in connect() 92 pub fn local_addr(&self) -> io::Result<SocketAddr> { in local_addr() 112 pub fn send_to(&self, buf: &[u8], target: SocketAddr) -> io::Result<usize> { in send_to() 132 pub fn recv_from(&self, buf: &mut [u8]) -> io::Result<(usize, SocketAddr)> { in recv_from() 152 pub fn peek_from(&self, buf: &mut [u8]) -> io::Result<(usize, SocketAddr)> { in peek_from() 170 pub fn set_broadcast(&self, on: bool) -> io::Result<()> { in set_broadcast() 189 pub fn broadcast(&self) -> io [all...] |
/commonlibrary/rust/ylong_http/ylong_http_client/src/async_impl/ |
H A D | http_body.rs | 17 use std::io::{Cursor, Read}; 76 io: BoxStreamData, 83 io.shutdown(); 88 BodyLength::Length(len) => Kind::Text(Text::new(len, pre, io, interceptors)), 89 BodyLength::UntilClose => Kind::UntilClose(UntilClose::new(pre, io, interceptors)), 92 BodyLength::Chunk => Kind::Chunk(Chunk::new(pre, io, interceptors)), 116 return Poll::Ready(err_from_io!(Timeout, std::io::ErrorKind::TimedOut.into())); in poll_data() 133 // Get trailer data from io in poll_trailer() 165 let io = match self.kind { in drop() 166 Kind::Text(ref mut text) => text.io in drop() [all...] |
/commonlibrary/rust/ylong_runtime/ylong_io/src/sys/unix/tcp/ |
H A D | stream.rs | 14 use std::io::{self, IoSlice, IoSliceMut, Read, Write}; 16 use std::os::unix::io::AsRawFd; 33 pub fn connect(addr: SocketAddr) -> io::Result<TcpStream> { in connect() 44 pub fn try_clone(&self) -> io::Result<Self> { in try_clone() 66 pub fn local_addr(&self) -> io::Result<SocketAddr> { in local_addr() 86 pub fn peer_addr(&self) -> io::Result<SocketAddr> { in peer_addr() 101 pub fn set_nodelay(&self, nodelay: bool) -> io::Result<()> { in set_nodelay() 117 pub fn nodelay(&self) -> io::Result<bool> { in nodelay() 133 pub fn linger(&self) -> io::Result<Option<Duration>> { in linger() 154 pub fn set_linger(&self, linger: Option<Duration>) -> io [all...] |
H A D | listener.rs | 14 use std::io; 17 use std::os::unix::io::{AsRawFd, FromRawFd}; 37 pub fn bind(addr: SocketAddr) -> io::Result<TcpListener> { in bind() 53 /// `io::ErrorKind::WouldBlock`. This means a stream may be ready at a 56 pub fn accept(&self) -> io::Result<(TcpStream, SocketAddr)> { in accept() 105 pub fn local_addr(&self) -> io::Result<SocketAddr> { in local_addr() 120 pub fn ttl(&self) -> io::Result<u32> { in ttl() 137 pub fn set_ttl(&self, ttl: u32) -> io::Result<()> { in set_ttl() 155 pub fn take_error(&self) -> io::Result<Option<io [all...] |
/commonlibrary/rust/ylong_runtime/ylong_runtime/src/executor/ |
H A D | driver_handle.rs | 16 use std::io; 41 pub(crate) io: IoHandle, 49 self.io.waker.wake().unwrap_or_else(|e| panic!("ylong_io wake failed, error: {e}")); 53 pub(crate) fn get_handle() -> io::Result<Arc<Handle>> { 55 .ok_or_else(|| io::Error::new(io::ErrorKind::Other, "get_current_ctx() fail"))?; 64 io: &mut impl Source, 66 ) -> io::Result<Ref<ScheduleIO>> { 67 self.io.register_source(io, interes [all...] |
/commonlibrary/rust/ylong_runtime/ylong_runtime/src/net/sys/tcp/ |
H A D | stream.rs | 15 use std::io; 16 use std::io::{IoSlice, Read, Write}; 26 use crate::io::{AsyncRead, AsyncWrite, ReadBuf}; 40 /// use std::io; 41 /// use std::io::{IoSlice, IoSliceMut}; 43 /// use ylong_runtime::io::{AsyncReadExt, AsyncWriteExt}; 46 /// async fn io_func() -> io::Result<()> { 86 /// use std::io; in fmt() 90 /// async fn io_func() -> io::Result<()> { in fmt() 96 pub async fn connect<A: ToSocketAddrs>(addr: A) -> io in fmt() [all...] |
H A D | listener.rs | 14 use std::io; 27 /// use std::io; 31 /// async fn io_func() -> io::Result<()> { 61 /// use std::io; 65 /// async fn io_func() -> io::Result<()> { 71 pub async fn bind<A: ToSocketAddrs>(addr: A) -> io::Result<TcpListener> { 88 /// use std::io; 92 /// async fn io_func() -> io::Result<()> { 99 pub async fn accept(&self) -> io::Result<(TcpStream, SocketAddr)> { 113 /// use std::io; [all...] |
/commonlibrary/rust/ylong_runtime/ylong_io/src/sys/windows/tcp/ |
H A D | stream.rs | 15 use std::io::{IoSlice, IoSliceMut, Read, Write}; 17 use std::os::windows::io::{AsRawSocket, FromRawSocket, IntoRawSocket, RawSocket}; 19 use std::{fmt, io, net}; 44 pub fn connect(addr: SocketAddr) -> io::Result<TcpStream> { in connect() 61 pub fn try_clone(&self) -> io::Result<Self> { in try_clone() 84 pub fn local_addr(&self) -> io::Result<SocketAddr> { in local_addr() 104 pub fn peer_addr(&self) -> io::Result<SocketAddr> { in peer_addr() 123 pub fn shutdown(&self, how: Shutdown) -> io::Result<()> { in shutdown() 138 pub fn set_nodelay(&self, nodelay: bool) -> io::Result<()> { in set_nodelay() 154 pub fn nodelay(&self) -> io [all...] |
H A D | listener.rs | 16 use std::os::windows::io::{AsRawSocket, FromRawSocket, IntoRawSocket, RawSocket}; 17 use std::{fmt, io, net}; 43 pub fn bind(addr: SocketAddr) -> io::Result<TcpListener> { in bind() 72 pub fn accept(&self) -> io::Result<(TcpStream, SocketAddr)> { in accept() 89 pub fn local_addr(&self) -> io::Result<SocketAddr> { in local_addr() 104 pub fn ttl(&self) -> io::Result<u32> { in ttl() 121 pub fn set_ttl(&self, ttl: u32) -> io::Result<()> { in set_ttl() 139 pub fn take_error(&self) -> io::Result<Option<io::Error>> { in take_error() 150 ) -> io in register() [all...] |
/commonlibrary/rust/ylong_runtime/ylong_runtime/src/process/sys/unix/ |
H A D | child.rs | 16 use std::io::IoSlice; 17 use std::os::unix::io::{AsFd, AsRawFd, BorrowedFd, IntoRawFd, OwnedFd, RawFd}; 21 use std::{fmt, io}; 24 use crate::io::{AsyncRead, AsyncWrite, ReadBuf}; 34 pub(crate) fn new(child: StdChild) -> io::Result<Self> { 46 pub(crate) fn kill(&mut self) -> io::Result<()> { 51 pub(crate) fn try_wait(&mut self) -> io::Result<Option<ExitStatus>> { 64 type Output = io::Result<ExitStatus>; in fmt() 92 pub(crate) fn stdio<T: IntoRawFd>(io: T) -> io [all...] |
/commonlibrary/rust/ylong_runtime/ylong_io/src/sys/unix/uds/ |
H A D | datagram.rs | 17 use std::{fmt, io}; 38 pub fn bind<P: AsRef<Path>>(path: P) -> io::Result<UnixDatagram> { in bind() 67 pub fn unbound() -> io::Result<UnixDatagram> { in unbound() 82 pub fn connect<P: AsRef<Path>>(&self, path: P) -> io::Result<()> { in connect() 97 pub fn pair() -> io::Result<(UnixDatagram, UnixDatagram)> { in pair() 108 /// fn test() -> std::io::Result<()> { 114 pub fn try_clone(&self) -> io::Result<UnixDatagram> { in try_clone() 124 /// fn test() -> std::io::Result<()> { 130 pub fn local_addr(&self) -> io::Result<net::SocketAddr> { in local_addr() 140 /// fn test() -> std::io [all...] |
H A D | stream.rs | 15 use std::io::{self, IoSlice, IoSliceMut, Read, Write}; 16 use std::os::unix::io::{AsRawFd, FromRawFd, IntoRawFd, RawFd}; 39 pub fn connect<P: AsRef<Path>>(path: P) -> io::Result<UnixStream> { in connect() 71 pub fn pair() -> io::Result<(UnixStream, UnixStream)> { in pair() 83 /// fn test() -> std::io::Result<()> { 89 pub fn try_clone(&self) -> io::Result<UnixStream> { in try_clone() 99 /// fn test() -> std::io::Result<()> { 105 pub fn local_addr(&self) -> io::Result<net::SocketAddr> { in local_addr() 115 /// fn test() -> std::io::Result<()> { 121 pub fn peer_addr(&self) -> io [all...] |
H A D | listener.rs | 14 use std::io; 16 use std::os::unix::io::{AsRawFd, FromRawFd, IntoRawFd, RawFd}; 42 pub fn bind<P: AsRef<Path>>(path: P) -> io::Result<UnixListener> { in bind() 52 /// fn test() -> std::io::Result<()> { 61 pub fn accept(&self) -> io::Result<(UnixStream, SocketAddr)> { in accept() 87 Ok::<net::UnixStream, io::Error>(socket) in accept() 120 /// fn test() -> std::io::Result<()> { 126 pub fn try_clone(&self) -> io::Result<UnixListener> { in try_clone() 136 /// fn test() -> std::io::Result<()> { 142 pub fn local_addr(&self) -> io [all...] |
/commonlibrary/rust/ylong_runtime/ylong_runtime/src/io/ |
H A D | stderr.rs | 15 use std::io; 16 use std::io::Write; 20 use crate::io::{AsyncWrite, State}; 27 std: Option<io::Stderr>, 28 state: State<io::Stderr>, 36 /// use ylong_runtime::io::stderr; 40 let std = io::stderr(); in stderr() 49 crate::io::stdio::std_async_write!(); 53 use std::os::unix::io::{AsFd, AsRawFd, BorrowedFd, RawFd}; 58 io in as_raw_fd() [all...] |
H A D | stdout.rs | 15 use std::io; 16 use std::io::Write; 20 use crate::io::{AsyncWrite, State}; 27 std: Option<io::Stdout>, 28 state: State<io::Stdout>, 36 /// use ylong_runtime::io::stdout; 40 let std = io::stdout(); in stdout() 49 crate::io::stdio::std_async_write!(); 53 use std::os::unix::io::{AsFd, AsRawFd, BorrowedFd, RawFd}; 58 io in as_raw_fd() [all...] |
H A D | async_write.rs | 14 use std::io; 15 use std::io::IoSlice; 20 use crate::io::write_task::{FlushTask, ShutdownTask, WriteAllTask, WriteTask, WriteVectoredTask}; 22 /// Async version of the `std::io::Write` trait. Provides all necessary writing 44 ) -> Poll<io::Result<usize>>; in poll_write() 54 ) -> Poll<io::Result<usize>> { in poll_write_vectored() 76 fn poll_flush(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<io::Result<()>>; in poll_flush() 94 fn poll_shutdown(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<io::Result<()>>; in poll_flush() 105 ) -> Poll<Result<usize, io::Error>> { in poll_flush() 115 ) -> Poll<Result<usize, io in poll_flush() [all...] |
/commonlibrary/rust/ylong_http/ylong_http_client/src/sync_impl/ |
H A D | http_body.rs | 14 use std::io::{Cursor, Read}; 59 pub(crate) fn text(len: u64, pre: &[u8], io: BoxStreamData) -> Self { 61 kind: Kind::Text(Text::new(len, pre, io)), 65 pub(crate) fn chunk(pre: &[u8], io: BoxStreamData, is_trailer: bool) -> Self { 67 kind: Kind::Chunk(Chunk::new(pre, io, is_trailer)), 82 io: Option<BoxStreamData>, 86 pub(crate) fn new(len: u64, pre: &[u8], io: BoxStreamData) -> Self { 90 io: Some(io), 139 if let Some(io) in data() [all...] |
/commonlibrary/rust/ylong_json/src/reader/ |
H A D | io_reader.rs | 15 use std::io::{Error, ErrorKind, Read, Result}; 31 io: R, 57 pub(crate) fn new(io: R) -> Self { 59 io, 68 // Try to read some bytes from io to fill buf. 74 return match self.io.read(self.buf.as_mut_slice()) { in read_bytes() 89 // If there is not enough bytes in buf, try to read some bytes from io and 228 use std::io::{ErrorKind, Read}; 242 fn read(&mut self, buf: &mut [u8]) -> std::io::Result<usize> { in read() 269 fn read(&mut self, _buf: &mut [u8]) -> std::io [all...] |
/commonlibrary/rust/ylong_runtime/ylong_runtime/src/process/pty_process/ |
H A D | pty.rs | 15 use std::io; 22 use crate::io::{AsyncRead, AsyncWrite, ReadBuf}; 39 pub fn new() -> io::Result<Self> { in new() 62 ) -> io::Result<()> { in resize() 77 pub fn pts(&self) -> io::Result<Pts> { in pts() 88 /// use std::io; 92 /// async fn io_func() -> io::Result<()> { 110 /// use std::io; 114 /// async fn io_func() -> io::Result<()> { 142 pub fn unsplit(read_pty: SplitReadPty, write_pty: SplitWritePty) -> io [all...] |
/commonlibrary/rust/ylong_runtime/ylong_io/src/sys/unix/ |
H A D | waker.rs | 14 use std::io; 38 use std::io::{Read, Write}; 39 use std::os::unix::io::FromRawFd; 51 pub(crate) fn new(selector: &Selector, token: Token) -> io::Result<WakerInner> { 55 let err = io::Error::last_os_error(); 64 pub(crate) fn wake(&self) -> io::Result<()> { 68 Err(ref err) if err.kind() == io::ErrorKind::WouldBlock => { 71 Err(err) if err.kind() != io::ErrorKind::WouldBlock => Err(err), 90 pub(crate) fn new(selector: &Selector, token: Token) -> io::Result<WakerInner> { 96 pub(crate) fn wake(&self) -> io [all...] |
/commonlibrary/rust/ylong_http/ylong_http_client/src/util/c_openssl/ssl/ |
H A D | error.rs | 16 use std::io; 32 Io(io::Error), 42 pub(crate) fn into_io_error(self) -> Result<io::Error, SslError> { 49 pub(crate) fn get_io_error(&self) -> Option<&io::Error> { 184 use std::io; 213 internal: Some(InternalError::Io(io::Error::from( in ut_ssl_error_into_io_error() 214 io::ErrorKind::BrokenPipe, in ut_ssl_error_into_io_error() 236 internal: Some(InternalError::Io(io::Error::from( in ut_ssl_error_source() 237 io::ErrorKind::BrokenPipe, in ut_ssl_error_source() 270 internal: Some(InternalError::Io(io in ut_ssl_error_fmt() [all...] |
/commonlibrary/rust/ylong_runtime/ylong_io/src/sys/windows/ |
H A D | net.rs | 14 use std::os::windows::io::RawSocket; 17 use std::{io, net}; 51 ) -> io::Result<()> { in register() 53 Some(_) => Err(io::ErrorKind::AlreadyExists.into()), in register() 61 pub fn deregister(&mut self) -> io::Result<()> { in deregister() 71 None => Err(io::ErrorKind::NotFound.into()), in deregister() 77 pub(crate) fn try_io<T, F, R>(&self, task: F, io: &T) -> io::Result<R> 79 F: FnOnce(&T) -> io::Result<R>, 81 let result = task(io); [all...] |
H A D | iocp.rs | 14 use std::os::windows::io::{AsRawHandle, IntoRawHandle, RawHandle}; 16 use std::{cmp, io}; 34 pub(crate) fn new() -> io::Result<CompletionPort> { 37 Err(io::Error::last_os_error()) 49 ) -> io::Result<()> { 62 ) -> io::Result<&'a mut [CompletionStatus]> { 87 pub(crate) fn post(&self, token: Token) -> io::Result<()> {
|