Enum wnf::StateLifetime
source · #[repr(u8)]pub enum StateLifetime {
WellKnown = 0,
Permanent = 1,
Persistent = 2,
Temporary = 3,
}
Expand description
The lifetime of a state
This property of a state controls at what point in time it is automatically deleted as well as if and how it is persisted.
Variants§
WellKnown = 0
Lifetime of a well-known state
A state with this lifetime cannot be created or deleted through the WNF API, but instead is provisioned with the system. It lives forever.
It is persisted in the Windows registry under the key
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Notifications
Permanent = 1
Lifetime of a permanent state
A state with this lifetime can be created and deleted through the WNF API at any time and is never deleted automatically.
Creating a state with this lifetime requires the SeCreatePermanentPrivilege
privilege.
It is persisted in the Windows registry under the key
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Notifications
Persistent = 2
Lifetime of a persistent state (also known as volatile)
A state with this lifetime can be created and deleted through the WNF API at any time and is automatically deleted on system reboot.
Creating a state with this lifetime requires the SeCreatePermanentPrivilege
privilege.
The name “persistent” is meant in relation to a temporary state name because it is persisted beyond the lifetime of the process it was created from. The alternative name “volatile” is meant in relation to a permanent state name because it is deleted on system reboot.
It is persisted in the Windows registry under the key
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\VolatileNotifications
Temporary = 3
Lifetime of a temporary state
A state with this lifetime can be created and deleted through the WNF API at any time and is automatically deleted when the process it was created from exits.
It is not persisted in the Windows registry.
Trait Implementations§
source§impl Clone for StateLifetime
impl Clone for StateLifetime
source§fn clone(&self) -> StateLifetime
fn clone(&self) -> StateLifetime
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for StateLifetime
impl Debug for StateLifetime
source§impl From<CreatableStateLifetime> for StateLifetime
impl From<CreatableStateLifetime> for StateLifetime
source§fn from(lifetime: CreatableStateLifetime) -> Self
fn from(lifetime: CreatableStateLifetime) -> Self
source§impl FromPrimitive for StateLifetime
impl FromPrimitive for StateLifetime
source§fn from_i64(n: i64) -> Option<Self>
fn from_i64(n: i64) -> Option<Self>
i64
to return an optional value of this type. If the
value cannot be represented by this type, then None
is returned.source§fn from_u64(n: u64) -> Option<Self>
fn from_u64(n: u64) -> Option<Self>
u64
to return an optional value of this type. If the
value cannot be represented by this type, then None
is returned.source§fn from_isize(n: isize) -> Option<Self>
fn from_isize(n: isize) -> Option<Self>
isize
to return an optional value of this type. If the
value cannot be represented by this type, then None
is returned.source§fn from_i8(n: i8) -> Option<Self>
fn from_i8(n: i8) -> Option<Self>
i8
to return an optional value of this type. If the
value cannot be represented by this type, then None
is returned.source§fn from_i16(n: i16) -> Option<Self>
fn from_i16(n: i16) -> Option<Self>
i16
to return an optional value of this type. If the
value cannot be represented by this type, then None
is returned.source§fn from_i32(n: i32) -> Option<Self>
fn from_i32(n: i32) -> Option<Self>
i32
to return an optional value of this type. If the
value cannot be represented by this type, then None
is returned.source§fn from_i128(n: i128) -> Option<Self>
fn from_i128(n: i128) -> Option<Self>
i128
to return an optional value of this type. If the
value cannot be represented by this type, then None
is returned. Read moresource§fn from_usize(n: usize) -> Option<Self>
fn from_usize(n: usize) -> Option<Self>
usize
to return an optional value of this type. If the
value cannot be represented by this type, then None
is returned.source§fn from_u8(n: u8) -> Option<Self>
fn from_u8(n: u8) -> Option<Self>
u8
to return an optional value of this type. If the
value cannot be represented by this type, then None
is returned.source§fn from_u16(n: u16) -> Option<Self>
fn from_u16(n: u16) -> Option<Self>
u16
to return an optional value of this type. If the
value cannot be represented by this type, then None
is returned.source§fn from_u32(n: u32) -> Option<Self>
fn from_u32(n: u32) -> Option<Self>
u32
to return an optional value of this type. If the
value cannot be represented by this type, then None
is returned.source§fn from_u128(n: u128) -> Option<Self>
fn from_u128(n: u128) -> Option<Self>
u128
to return an optional value of this type. If the
value cannot be represented by this type, then None
is returned. Read moresource§impl Hash for StateLifetime
impl Hash for StateLifetime
source§impl PartialEq for StateLifetime
impl PartialEq for StateLifetime
source§fn eq(&self, other: &StateLifetime) -> bool
fn eq(&self, other: &StateLifetime) -> bool
self
and other
values to be equal, and is used
by ==
.impl Copy for StateLifetime
impl Eq for StateLifetime
impl StructuralPartialEq for StateLifetime
Auto Trait Implementations§
impl Freeze for StateLifetime
impl RefUnwindSafe for StateLifetime
impl Send for StateLifetime
impl Sync for StateLifetime
impl Unpin for StateLifetime
impl UnwindSafe for StateLifetime
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)source§impl<T> CloneToUninit for Twhere
T: Copy,
impl<T> CloneToUninit for Twhere
T: Copy,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)