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
impl NamedPipeBuilder
sourcepub fn new<A: AsRef<OsStr>>(addr: A) -> NamedPipeBuilder
pub fn new<A: AsRef<OsStr>>(addr: A) -> NamedPipeBuilder
Creates a new named pipe builder with the default settings.
sourcepub fn inbound(&mut self, allowed: bool) -> &mut Self
pub fn inbound(&mut self, allowed: bool) -> &mut Self
Indicates whether data is allowed to flow from the client to the server.
sourcepub fn outbound(&mut self, allowed: bool) -> &mut Self
pub fn outbound(&mut self, allowed: bool) -> &mut Self
Indicates whether data is allowed to flow from the server to the client.
sourcepub fn first(&mut self, first: bool) -> &mut Self
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.
sourcepub fn accept_remote(&mut self, accept: bool) -> &mut Self
pub fn accept_remote(&mut self, accept: bool) -> &mut Self
Indicates whether this server can accept remote clients or not.
sourcepub fn max_instances(&mut self, instances: u8) -> &mut Self
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.
sourcepub fn out_buffer_size(&mut self, buffer: u32) -> &mut Self
pub fn out_buffer_size(&mut self, buffer: u32) -> &mut Self
Specifies the number of bytes to reserver for the output buffer
sourcepub fn in_buffer_size(&mut self, buffer: u32) -> &mut Self
pub fn in_buffer_size(&mut self, buffer: u32) -> &mut Self
Specifies the number of bytes to reserver for the input buffer
sourcepub fn create(&mut self) -> Result<NamedPipe>
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.
sourcepub unsafe fn with_security_attributes(
&mut self,
attrs: *mut SECURITY_ATTRIBUTES
) -> Result<NamedPipe>
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.