mirror of
https://github.com/szymon-jozef/libnotify-rs.git
synced 2026-10-27 19:20:43 +01:00
docs: add example to uninit
This commit is contained in:
@@ -54,6 +54,19 @@ where
|
|||||||
/// Uninitializes libnotify.
|
/// Uninitializes libnotify.
|
||||||
///
|
///
|
||||||
/// This should be called when the program no longer needs libnotify for the rest of its lifecycle, typically just before exitting.
|
/// This should be called when the program no longer needs libnotify for the rest of its lifecycle, typically just before exitting.
|
||||||
|
///
|
||||||
|
/// # Example
|
||||||
|
/// ```
|
||||||
|
/// use libnotify_rs::api::functions::{init, uninit};
|
||||||
|
///
|
||||||
|
/// fn main() -> Result<(), Box<dyn std::error::Error>> {
|
||||||
|
/// init("Test app")?;
|
||||||
|
/// // let notify = ...
|
||||||
|
/// uninit(); // __always__ uninit libnotify after use
|
||||||
|
/// Ok(())
|
||||||
|
/// }
|
||||||
|
///
|
||||||
|
/// ```
|
||||||
pub fn uninit() {
|
pub fn uninit() {
|
||||||
unsafe {
|
unsafe {
|
||||||
notify_uninit();
|
notify_uninit();
|
||||||
|
|||||||
Reference in New Issue
Block a user