pub struct IoHandleData {
pub kind: IoHandleKind,
pub resource: Arc<Mutex<Option<IoResource>>>,
pub path: String,
pub mode: String,
}Expand description
Data for IoHandle variant (boxed to keep HeapValue small).
Wraps an OS resource (file, socket, process) in an Arc<Mutex<OptionOption is None after close().
Rust’s Drop closes the underlying resource if not already closed.
Fields§
§kind: IoHandleKind§resource: Arc<Mutex<Option<IoResource>>>§path: String§mode: StringImplementations§
Source§impl IoHandleData
impl IoHandleData
Sourcepub fn new_tcp_stream(stream: TcpStream, addr: String) -> Self
pub fn new_tcp_stream(stream: TcpStream, addr: String) -> Self
Create a new TCP stream handle.
Sourcepub fn new_tcp_listener(listener: TcpListener, addr: String) -> Self
pub fn new_tcp_listener(listener: TcpListener, addr: String) -> Self
Create a new TCP listener handle.
Sourcepub fn new_udp_socket(socket: UdpSocket, addr: String) -> Self
pub fn new_udp_socket(socket: UdpSocket, addr: String) -> Self
Create a new UDP socket handle.
Sourcepub fn new_child_process(child: Child, cmd: String) -> Self
pub fn new_child_process(child: Child, cmd: String) -> Self
Create a handle wrapping a spawned child process.
Sourcepub fn new_pipe_reader(stdout: ChildStdout, label: String) -> Self
pub fn new_pipe_reader(stdout: ChildStdout, label: String) -> Self
Create a handle wrapping a child stdout pipe.
Sourcepub fn new_pipe_writer(stdin: ChildStdin, label: String) -> Self
pub fn new_pipe_writer(stdin: ChildStdin, label: String) -> Self
Create a handle wrapping a child stdin pipe.
Sourcepub fn new_pipe_reader_err(stderr: ChildStderr, label: String) -> Self
pub fn new_pipe_reader_err(stderr: ChildStderr, label: String) -> Self
Create a handle wrapping a child stderr pipe.
Trait Implementations§
Source§impl Clone for IoHandleData
impl Clone for IoHandleData
Source§fn clone(&self) -> IoHandleData
fn clone(&self) -> IoHandleData
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for IoHandleData
impl RefUnwindSafe for IoHandleData
impl Send for IoHandleData
impl Sync for IoHandleData
impl Unpin for IoHandleData
impl UnsafeUnpin for IoHandleData
impl UnwindSafe for IoHandleData
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more