Struct HKEY

Source
pub struct HKEY(/* private fields */);
Available on crate feature advapi only.
Expand description

Handle to a registry key.

This handle also exposes several predefined registry keys, like HKEY::CURRENT_USER, which are always open and ready to be used. Usually, they are the starting point to open a registry key.

Trait Implementations§

Source§

impl Debug for HKEY

Source§

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

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

impl Display for HKEY

Source§

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

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

impl Handle for HKEY

Source§

const NULL: Self

Available on crate feature kernel only.
The null, uninitialized handle; equals to 0.
Source§

const INVALID: Self

Available on crate feature kernel only.
The invalid handle; equals to -1. Read more
Source§

unsafe fn from_ptr(p: *mut c_void) -> Self

Available on crate feature kernel only.
Creates a new handle object by wrapping a pointer. Read more
Source§

unsafe fn as_mut(&mut self) -> &mut *mut c_void

Available on crate feature kernel only.
Returns a mutable reference to the underlying raw pointer. Read more
Source§

unsafe fn raw_copy(&self) -> Self

Available on crate feature kernel only.
Returns a raw copy of the underlying handle pointer. Read more
Source§

fn ptr(&self) -> *mut c_void

Available on crate feature kernel only.
Returns the underlying raw pointer. Read more
Source§

fn as_opt(&self) -> Option<&Self>

Available on crate feature kernel only.
Returns None if the handle is null or invalid, otherwise returns Some(&self). Read more
Source§

impl Hash for HKEY

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl LowerHex for HKEY

Source§

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

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

impl PartialEq for HKEY

Source§

fn eq(&self, other: &HKEY) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl UpperHex for HKEY

Source§

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

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

impl advapi_Hkey for HKEY

Source§

const CLASSES_ROOT: HKEY = _

Predefined registry key, always open.
Source§

const CURRENT_USER: HKEY = _

Predefined registry key, always open.
Source§

const LOCAL_MACHINE: HKEY = _

Predefined registry key, always open.
Source§

const USERS: HKEY = _

Predefined registry key, always open.
Source§

const PERFORMANCE_DATA: HKEY = _

Predefined registry key, always open.
Source§

const CURRENT_CONFIG: HKEY = _

Predefined registry key, always open.
Source§

const DYN_DATA: HKEY = _

Predefined registry key, always open.
Source§

const CURRENT_USER_LOCAL_SETTINGS: HKEY = _

Predefined registry key, always open.
Source§

const PERFORMANCE_TEXT: HKEY = _

Predefined registry key, always open.
Source§

const PERFORMANCE_NLSTEXT: HKEY = _

Predefined registry key, always open.
Source§

fn RegConnectRegistry( machine_name: Option<&str>, predef_hkey: &HKEY, ) -> SysResult<RegCloseKeyGuard>

Source§

fn RegCopyTree(&self, sub_key: Option<&str>, dest: &HKEY) -> SysResult<()>

RegCopyTree function.
Source§

fn RegCreateKeyEx( &self, sub_key: &str, class: Option<&str>, options: REG_OPTION, access_rights: KEY, security_attributes: Option<&SECURITY_ATTRIBUTES<'_>>, ) -> SysResult<(RegCloseKeyGuard, REG_DISPOSITION)>

RegCreateKeyEx function.
Source§

fn RegCreateKeyTransacted( &self, sub_key: &str, class: Option<&str>, options: REG_OPTION, access_rights: KEY, security_attributes: Option<&SECURITY_ATTRIBUTES<'_>>, htransaction: &HTRANSACTION, ) -> SysResult<(RegCloseKeyGuard, REG_DISPOSITION)>

Source§

fn RegDeleteKey(&self, sub_key: &str) -> SysResult<()>

RegDeleteKey function.
Source§

fn RegDeleteKeyEx(&self, sub_key: &str, platform_view: KEY) -> SysResult<()>

Source§

fn RegDeleteKeyTransacted( &self, sub_key: &str, access_rights: KEY, htransaction: &HTRANSACTION, ) -> SysResult<()>

Source§

fn RegDeleteTree(&self, sub_key: Option<&str>) -> SysResult<()>

RegDeleteTree function.
Source§

fn RegDeleteValue(&self, value_name: Option<&str>) -> SysResult<()>

RegDeleteValue function.
Source§

fn RegDisableReflectionKey(&self) -> SysResult<()>

Source§

fn RegEnableReflectionKey(&self) -> SysResult<()>

Source§

fn RegEnumKeyEx( &self, ) -> SysResult<impl Iterator<Item = SysResult<String>> + '_>

Returns an iterator over the names of the keys, which calls RegEnumKeyEx repeatedly. Read more
Source§

fn RegEnumValue( &self, ) -> SysResult<impl Iterator<Item = SysResult<(String, REG)>> + '_>

Returns an iterator of the names and types of the values, which calls RegEnumValue repeatedly. Read more
Source§

fn RegFlushKey(&self) -> SysResult<()>

RegFlushKey function.
Source§

fn RegGetValue( &self, sub_key: Option<&str>, value_name: Option<&str>, flags: RRF, ) -> SysResult<RegistryValue>

Source§

fn RegLoadKey(&self, sub_key: Option<&str>, file_path: &str) -> SysResult<()>

RegLoadKey function.
Source§

fn RegOpenCurrentUser(access_rights: KEY) -> SysResult<RegCloseKeyGuard>

Source§

fn RegOpenKeyEx( &self, sub_key: Option<&str>, options: REG_OPTION, access_rights: KEY, ) -> SysResult<RegCloseKeyGuard>

Source§

fn RegOpenKeyTransacted( &self, sub_key: &str, options: REG_OPTION, access_rights: KEY, htransaction: &HTRANSACTION, ) -> SysResult<RegCloseKeyGuard>

Source§

fn RegQueryInfoKey( &self, class: Option<&mut WString>, num_sub_keys: Option<&mut u32>, max_sub_key_name_len: Option<&mut u32>, max_class_len: Option<&mut u32>, num_values: Option<&mut u32>, max_value_name_len: Option<&mut u32>, max_value_len: Option<&mut u32>, security_descr_len: Option<&mut u32>, last_write_time: Option<&mut FILETIME>, ) -> SysResult<()>

RegQueryInfoKey function.
Source§

fn RegQueryMultipleValues( &self, value_names: &[impl AsRef<str>], ) -> SysResult<Vec<RegistryValue>>

Source§

fn RegQueryReflectionKey(&self) -> SysResult<bool>

Source§

fn RegQueryValueEx(&self, value_name: Option<&str>) -> SysResult<RegistryValue>

Source§

fn RegRenameKey(&self, sub_key_name: &str, new_key_name: &str) -> SysResult<()>

RegRenameKey function.
Source§

fn RegReplaceKey( &self, sub_key: Option<&str>, new_src_file: &str, old_file_backup: &str, ) -> SysResult<()>

RegReplaceKey function.
Source§

fn RegRestoreKey(&self, file_path: &str, flags: REG_RESTORE) -> SysResult<()>

RegRestoreKey function.
Source§

fn RegSaveKey( &self, dest_file_path: &str, security_attributes: Option<&SECURITY_ATTRIBUTES<'_>>, ) -> SysResult<()>

RegSaveKey function.
Source§

fn RegSaveKeyEx( &self, dest_file_path: &str, security_attributes: Option<&SECURITY_ATTRIBUTES<'_>>, flags: REG_SAVE, ) -> SysResult<()>

RegSaveKeyEx function.
Source§

fn RegSetKeyValue( &self, sub_key: Option<&str>, value_name: Option<&str>, data: RegistryValue, ) -> SysResult<()>

Source§

fn RegSetValueEx( &self, value_name: Option<&str>, data: RegistryValue, ) -> SysResult<()>

Source§

fn RegUnLoadKey(&self, sub_key: Option<&str>) -> SysResult<()>

RegUnLoadKey function.
Source§

impl Eq for HKEY

Source§

impl Send for HKEY

Source§

impl StructuralPartialEq for HKEY

Auto Trait Implementations§

§

impl Freeze for HKEY

§

impl RefUnwindSafe for HKEY

§

impl !Sync for HKEY

§

impl Unpin for HKEY

§

impl UnwindSafe for HKEY

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> 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> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. 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.