Struct ProcThreadAttributeListBuilder
struct ProcThreadAttributeListBuilder<'a> { ... }
Builder for constructing a ProcThreadAttributeList.
Implementations
impl<'a> ProcThreadAttributeListBuilder<'a>
fn attribute<T>(self: Self, attribute: usize, value: &'a T) -> SelfSets an attribute on the attribute list.
The
attributeparameter specifies the raw attribute to be set, while thevalueparameter holds the value associated with that attribute. Please refer to the Windows documentation for a list of valid attributes.Note
The maximum number of attributes is the value of
u32::MAX. If this limit is exceeded, the call toSelf::finishwill return anErrorindicating that the maximum number of attributes has been exceeded.Safety Note
Remember that improper use of attributes can lead to undefined behavior or security vulnerabilities. Always consult the documentation and ensure proper attribute values are used.
unsafe fn raw_attribute<T>(self: Self, attribute: usize, value_ptr: *const T, value_size: usize) -> SelfSets a raw attribute on the attribute list.
This function is useful for setting attributes with pointers or sizes that cannot be derived directly from their values.
Safety
This function is marked as
unsafebecause it deals with raw pointers and sizes. It is the responsibility of the caller to ensure the value lives longer than the resultingProcThreadAttributeListas well as the validity of the size parameter.Example
use c_void; use ; use HANDLE; use Command; unsafe extern "system" let = ; unsafe let size = COORD ; let mut h_pc = unsafe ; unsafe ; unsafe ; unsafe ; const PROC_THREAD_ATTRIBUTE_PSEUDOCONSOLE: usize = 131094; let attribute_list = unsafe ; let mut child = new.spawn_with_attributes?; # # child.kill?; # Ok::fn finish(self: &Self) -> io::Result<ProcThreadAttributeList<'a>>Finalizes the construction of the
ProcThreadAttributeList.Errors
Returns an error if the maximum number of attributes is exceeded or if there is an I/O error during initialization.
impl<'a> Clone for ProcThreadAttributeListBuilder<'a>
fn clone(self: &Self) -> ProcThreadAttributeListBuilder<'a>
impl<'a> Debug for ProcThreadAttributeListBuilder<'a>
fn fmt(self: &Self, f: &mut $crate::fmt::Formatter<'_>) -> $crate::fmt::Result
impl<'a> Freeze for ProcThreadAttributeListBuilder<'a>
impl<'a> RefUnwindSafe for ProcThreadAttributeListBuilder<'a>
impl<'a> Send for ProcThreadAttributeListBuilder<'a>
impl<'a> Sync for ProcThreadAttributeListBuilder<'a>
impl<'a> Unpin for ProcThreadAttributeListBuilder<'a>
impl<'a> UnwindSafe for ProcThreadAttributeListBuilder<'a>
impl<T> Any for ProcThreadAttributeListBuilder<'a>
fn type_id(self: &Self) -> TypeId
impl<T> Borrow for ProcThreadAttributeListBuilder<'a>
fn borrow(self: &Self) -> &T
impl<T> BorrowMut for ProcThreadAttributeListBuilder<'a>
fn borrow_mut(self: &mut Self) -> &mut T
impl<T> CloneToUninit for ProcThreadAttributeListBuilder<'a>
unsafe fn clone_to_uninit(self: &Self, dest: *mut u8)
impl<T> From for ProcThreadAttributeListBuilder<'a>
fn from(t: T) -> TReturns the argument unchanged.
impl<T> ToOwned for ProcThreadAttributeListBuilder<'a>
fn to_owned(self: &Self) -> Tfn clone_into(self: &Self, target: &mut T)
impl<T, U> Into for ProcThreadAttributeListBuilder<'a>
fn into(self: Self) -> UCalls
U::from(self).That is, this conversion is whatever the implementation of
[From]<T> for Uchooses to do.
impl<T, U> TryFrom for ProcThreadAttributeListBuilder<'a>
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
impl<T, U> TryInto for ProcThreadAttributeListBuilder<'a>
fn try_into(self: Self) -> Result<U, <U as TryFrom<T>>::Error>