Enum wnf::StateLifetime
source · #[repr(u8)]
pub enum StateLifetime {
WellKnown,
Permanent,
Persistent,
Temporary,
}
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
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
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
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
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>
has_i128
only.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>
has_i128
only.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<StateLifetime> for StateLifetime
impl PartialEq<StateLifetime> 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 ==
.