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§

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more
Converts to this type from the input type.
Converts an i64 to return an optional value of this type. If the value cannot be represented by this type, then None is returned.
Converts an u64 to return an optional value of this type. If the value cannot be represented by this type, then None is returned.
Converts an isize to return an optional value of this type. If the value cannot be represented by this type, then None is returned.
Converts an i8 to return an optional value of this type. If the value cannot be represented by this type, then None is returned.
Converts an i16 to return an optional value of this type. If the value cannot be represented by this type, then None is returned.
Converts an i32 to return an optional value of this type. If the value cannot be represented by this type, then None is returned.
Available on has_i128 only.
Converts an i128 to return an optional value of this type. If the value cannot be represented by this type, then None is returned. Read more
Converts a usize to return an optional value of this type. If the value cannot be represented by this type, then None is returned.
Converts an u8 to return an optional value of this type. If the value cannot be represented by this type, then None is returned.
Converts an u16 to return an optional value of this type. If the value cannot be represented by this type, then None is returned.
Converts an u32 to return an optional value of this type. If the value cannot be represented by this type, then None is returned.
Available on has_i128 only.
Converts an u128 to return an optional value of this type. If the value cannot be represented by this type, then None is returned. Read more
Converts a f32 to return an optional value of this type. If the value cannot be represented by this type, then None is returned.
Converts a f64 to return an optional value of this type. If the value cannot be represented by this type, then None is returned. Read more
Feeds this value into the given Hasher. Read more
Feeds a slice of this type into the given Hasher. Read more
This method tests for self and other values to be equal, and is used by ==.
This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.
Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more