Enum interprocess_docfix::os::windows::named_pipe::PipeDirection
source · #[repr(u32)]pub enum PipeDirection {
ClientToServer,
ServerToClient,
Duplex,
}Expand description
The direction of a named pipe connection, designating who can read data and who can write it. This describes the direction of the data flow unambiguously, so that the meaning of the values is the same for the client and server – ClientToServer always means client → server, for example.
Variants§
ClientToServer
Represents a server ← client data flow: clients write data, the server reads it.
ServerToClient
Represents a server → client data flow: the server writes data, clients read it.
Duplex
Represents a server ⇄ client data flow: the server can write data which then is read by the client, while the client writes data which is read by the server.
Implementations§
source§impl PipeDirection
impl PipeDirection
sourcepub const fn client_role(self) -> PipeStreamRole
pub const fn client_role(self) -> PipeStreamRole
Returns the role which the pipe client will have in this direction setting.
Usage
assert_eq!(
PipeDirection::ClientToServer.client_role(),
PipeStreamRole::Writer,
);
assert_eq!(
PipeDirection::ServerToClient.client_role(),
PipeStreamRole::Reader,
);
assert_eq!(
PipeDirection::Duplex.client_role(),
PipeStreamRole::ReaderAndWriter,
);sourcepub const fn server_role(self) -> PipeStreamRole
pub const fn server_role(self) -> PipeStreamRole
Returns the role which the pipe server will have in this direction setting.
Usage
assert_eq!(
PipeDirection::ClientToServer.server_role(),
PipeStreamRole::Reader,
);
assert_eq!(
PipeDirection::ServerToClient.server_role(),
PipeStreamRole::Writer,
);
assert_eq!(
PipeDirection::Duplex.server_role(),
PipeStreamRole::ReaderAndWriter,
);Trait Implementations§
source§impl Clone for PipeDirection
impl Clone for PipeDirection
source§fn clone(&self) -> PipeDirection
fn clone(&self) -> PipeDirection
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moresource§impl Debug for PipeDirection
impl Debug for PipeDirection
source§impl From<PipeDirection> for u32
impl From<PipeDirection> for u32
source§fn from(op: PipeDirection) -> Self
fn from(op: PipeDirection) -> Self
source§impl Hash for PipeDirection
impl Hash for PipeDirection
source§impl PartialEq<PipeDirection> for PipeDirection
impl PartialEq<PipeDirection> for PipeDirection
source§fn eq(&self, other: &PipeDirection) -> bool
fn eq(&self, other: &PipeDirection) -> bool
self and other values to be equal, and is used
by ==.