#[repr(u32)]pub enum PipeDirection {
ClientToServer = 0,
ServerToClient = 1,
Duplex = 2,
}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 = 0
Represents a server ← client data flow: clients write data, the server reads it.
ServerToClient = 1
Represents a server → client data flow: the server writes data, clients read it.
Duplex = 2
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 more