#[non_exhaustive]pub struct UnnamedPipeCreationOptions {
pub inheritable: bool,
pub security_descriptor: *mut c_void,
pub buffer_size_hint: Option<NonZeroUsize>,
}Expand description
Builder used to create unnamed pipes while supplying additional options.
You can use this instead of the simple pipe function to supply additional Windows-specific parameters to a pipe.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.inheritable: boolSpecifies whether the resulting pipe can be inherited by child processes.
The default value is true and you probably shouldn’t modify this, unless you want all child processes to explicitly be unable to use the pipe even if they attempt to use various fishy methods to find the handle in the parent process.
security_descriptor: *mut c_voidA pointer to the security descriptor for the pipe. Leave this at the default NULL unless you want something specific.
buffer_size_hint: Option<NonZeroUsize>A hint on the buffer size for the pipe. There is no way to ensure or check that the system actually uses this exact size, since it’s only a hint. Set to None to disable the hint and rely entirely on the system’s default buffer size.
Implementations§
Source§impl UnnamedPipeCreationOptions
impl UnnamedPipeCreationOptions
Sourcepub const fn new() -> Self
pub const fn new() -> Self
Starts with the default parameters for the pipe. Identical to Default::default().
Sourcepub fn inheritable(self, inheritable: bool) -> Self
pub fn inheritable(self, inheritable: bool) -> Self
Specifies whether the resulting pipe can be inherited by child processes.
See the associated field for more.
Sourcepub fn security_descriptor(self, security_descriptor: *mut c_void) -> Self
pub fn security_descriptor(self, security_descriptor: *mut c_void) -> Self
Specifies the pointer to the security descriptor for the pipe.
See the associated field for more.
Sourcepub fn buffer_size_hint(self, buffer_size_hint: Option<NonZeroUsize>) -> Self
pub fn buffer_size_hint(self, buffer_size_hint: Option<NonZeroUsize>) -> Self
Specifies the hint on the buffer size for the pipe.
See the associated field for more.
Sourcepub fn extract_security_attributes(self) -> SECURITY_ATTRIBUTES
pub fn extract_security_attributes(self) -> SECURITY_ATTRIBUTES
Extracts the SECURITY_ATTRIBUTES from the builder. Primarily an implementation detail, but has other uses.
Sourcepub unsafe fn build(self) -> Result<(PubWriter, PubReader)>
pub unsafe fn build(self) -> Result<(PubWriter, PubReader)>
Creates the pipe and returns its writing and reading ends, or the error if one occurred.
§Safety
The security_descriptor field is passed directly to Win32 which is then dereferenced there, resulting in undefined behavior if it was an invalid non-null pointer. For the default configuration, this should never be a concern.
Trait Implementations§
Source§impl Clone for UnnamedPipeCreationOptions
impl Clone for UnnamedPipeCreationOptions
Source§fn clone(&self) -> UnnamedPipeCreationOptions
fn clone(&self) -> UnnamedPipeCreationOptions
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more