#[repr(u32)]pub enum PipeStreamRole {
Reader = 0,
Writer = 1,
ReaderAndWriter = 2,
}Available on Windows only.
Expand description
Describes the role of a named pipe stream. In constrast to PipeDirection, the meaning of values here is relative – for example, Reader means ServerToClient if you’re creating a server and ClientToServer if you’re creating a client.
This enumeration is also not layout-compatible with the PIPE_ACCESS_* constants, in contrast to PipeDirection.
Variants§
Reader = 0
The stream only reads data.
Writer = 1
The stream only writes data.
ReaderAndWriter = 2
The stream both reads and writes data.
Implementations§
Source§impl PipeStreamRole
impl PipeStreamRole
Sourcepub const fn direction_as_server(self) -> PipeDirection
pub const fn direction_as_server(self) -> PipeDirection
Returns the data flow direction of the data stream, assuming that the value describes the role of the server.
§Usage
assert_eq!(
PipeStreamRole::Reader.direction_as_server(),
PipeDirection::ClientToServer,
);
assert_eq!(
PipeStreamRole::Writer.direction_as_server(),
PipeDirection::ServerToClient,
);
assert_eq!(
PipeStreamRole::ReaderAndWriter.direction_as_server(),
PipeDirection::Duplex,
);Sourcepub const fn direction_as_client(self) -> PipeDirection
pub const fn direction_as_client(self) -> PipeDirection
Returns the data flow direction of the data stream, assuming that the value describes the role of the client.
§Usage
assert_eq!(
PipeStreamRole::Reader.direction_as_client(),
PipeDirection::ServerToClient,
);
assert_eq!(
PipeStreamRole::Writer.direction_as_client(),
PipeDirection::ClientToServer,
);
assert_eq!(
PipeStreamRole::ReaderAndWriter.direction_as_client(),
PipeDirection::Duplex,
);Trait Implementations§
Source§impl Clone for PipeStreamRole
impl Clone for PipeStreamRole
Source§fn clone(&self) -> PipeStreamRole
fn clone(&self) -> PipeStreamRole
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 moreSource§impl Debug for PipeStreamRole
impl Debug for PipeStreamRole
Source§impl Hash for PipeStreamRole
impl Hash for PipeStreamRole
Source§impl PartialEq for PipeStreamRole
impl PartialEq for PipeStreamRole
impl Copy for PipeStreamRole
impl Eq for PipeStreamRole
impl StructuralPartialEq for PipeStreamRole
Auto Trait Implementations§
impl Freeze for PipeStreamRole
impl RefUnwindSafe for PipeStreamRole
impl Send for PipeStreamRole
impl Sync for PipeStreamRole
impl Unpin for PipeStreamRole
impl UnwindSafe for PipeStreamRole
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