Struct miow::pipe::NamedPipeBuilder

source ·
pub struct NamedPipeBuilder { /* private fields */ }
Expand description

A builder structure for creating a new named pipe.

Implementations§

source§

impl NamedPipeBuilder

source

pub fn new<A: AsRef<OsStr>>(addr: A) -> NamedPipeBuilder

Creates a new named pipe builder with the default settings.

source

pub fn inbound(&mut self, allowed: bool) -> &mut Self

Indicates whether data is allowed to flow from the client to the server.

source

pub fn outbound(&mut self, allowed: bool) -> &mut Self

Indicates whether data is allowed to flow from the server to the client.

source

pub fn first(&mut self, first: bool) -> &mut Self

Indicates that this pipe must be the first instance.

If set to true, then creation will fail if there’s already an instance elsewhere.

source

pub fn accept_remote(&mut self, accept: bool) -> &mut Self

Indicates whether this server can accept remote clients or not.

source

pub fn max_instances(&mut self, instances: u8) -> &mut Self

Specifies the maximum number of instances of the server pipe that are allowed.

The first instance of a pipe can specify this value. A value of 255 indicates that there is no limit to the number of instances.

source

pub fn out_buffer_size(&mut self, buffer: u32) -> &mut Self

Specifies the number of bytes to reserver for the output buffer

source

pub fn in_buffer_size(&mut self, buffer: u32) -> &mut Self

Specifies the number of bytes to reserver for the input buffer

source

pub fn create(&mut self) -> Result<NamedPipe>

Using the options in this builder, attempt to create a new named pipe.

This function will call the CreateNamedPipe function and return the result.

source

pub unsafe fn with_security_attributes( &mut self, attrs: *mut SECURITY_ATTRIBUTES ) -> Result<NamedPipe>

Using the options in the builder and the provided security attributes, attempt to create a new named pipe. This function has to be called with a valid pointer to a SECURITY_ATTRIBUTES struct that will stay valid for the lifetime of this function or a null pointer.

This function will call the CreateNamedPipe function and return the result.

Trait Implementations§

source§

impl Debug for NamedPipeBuilder

source§

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

Formats the value using the given formatter. Read more

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, 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.