Struct winsafe::HKEY

source ·
pub struct HKEY(/* private fields */);
Available on crate feature kernel 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 = _

The null, uninitialized handle; equals to 0.
source§

const INVALID: Self = _

The invalid handle; equals to -1. Read more
source§

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

Creates a new handle object by wrapping a pointer. Read more
source§

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

Returns a mutable reference to the underlying raw pointer. Read more
source§

unsafe fn raw_copy(&self) -> Self

Returns a raw copy of the underlying handle pointer. Read more
source§

fn ptr(&self) -> *mut c_void

Returns the underlying raw pointer. Read more
source§

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

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.
source§

impl PartialEq for HKEY

source§

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

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

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

This method 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.
source§

impl kernel_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 RegDisablePredefinedCache() -> SysResult<()>

source§

fn RegDisablePredefinedCacheEx() -> SysResult<()>

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> ) -> 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§

default 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>,

§

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>,

§

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.