#[repr(u32)]
pub enum PipeDirection { ClientToServer, ServerToClient, Duplex, }
Available on Windows only.
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

source

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,
);
source

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

source§

fn clone(&self) -> PipeDirection

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for PipeDirection

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl From<PipeDirection> for u32

source§

fn from(op: PipeDirection) -> Self

Converts to this type from the input type.
source§

impl Hash for PipeDirection

source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl PartialEq<PipeDirection> for PipeDirection

source§

fn eq(&self, other: &PipeDirection) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl TryFrom<u32> for PipeDirection

source§

fn try_from(op: u32) -> Result<Self, ()>

Converts a Windows constant to a PipeDirection if it’s in range.

Errors

Returns Err if the value is not a valid pipe direction constant.

§

type Error = ()

The type returned in the event of a conversion error.
source§

impl Copy for PipeDirection

source§

impl Eq for PipeDirection

source§

impl StructuralEq for PipeDirection

source§

impl StructuralPartialEq for PipeDirection

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> To for Twhere T: ?Sized,

source§

fn to<T>(self) -> Twhere Self: Into<T>,

Converts to T by calling Into<T>::into.
source§

fn try_to<T>(self) -> Result<T, Self::Error>where Self: TryInto<T>,

Tries to convert to T by calling TryInto<T>::try_into.
source§

impl<T> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.