UnnamedPipeCreationOptions

Struct UnnamedPipeCreationOptions 

Source
#[non_exhaustive]
pub struct UnnamedPipeCreationOptions { pub inheritable: bool, pub security_descriptor: *mut c_void, pub buffer_size_hint: Option<NonZeroUsize>, }
Available on Windows only.
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
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.
§inheritable: bool

Specifies 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_void

A 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

Source

pub const fn new() -> Self

Starts with the default parameters for the pipe. Identical to Default::default().

Source

pub fn inheritable(self, inheritable: bool) -> Self

Specifies whether the resulting pipe can be inherited by child processes.

See the associated field for more.

Source

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.

Source

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.

Source

pub fn extract_security_attributes(self) -> SECURITY_ATTRIBUTES

Extracts the SECURITY_ATTRIBUTES from the builder. Primarily an implementation detail, but has other uses.

Source

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

Source§

fn clone(&self) -> UnnamedPipeCreationOptions

Returns a duplicate 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 UnnamedPipeCreationOptions

Source§

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

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

impl Default for UnnamedPipeCreationOptions

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl Copy for UnnamedPipeCreationOptions

Source§

impl Send for UnnamedPipeCreationOptions

Source§

impl Sync for UnnamedPipeCreationOptions

Auto Trait Implementations§

Blanket Implementations§

Source§

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

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

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

Source§

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

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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 T
where 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 T
where T: ?Sized,

Source§

fn to<T>(self) -> T
where 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 T
where T: Clone,

Source§

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 T
where U: Into<T>,

Source§

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 T
where U: TryFrom<T>,

Source§

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.