mirror of
https://github.com/szymon-jozef/libnotify-rs.git
synced 2026-10-27 19:20:43 +01:00
docs: add doctest to is_inited
This commit is contained in:
@@ -74,6 +74,20 @@ pub fn uninit() {
|
||||
}
|
||||
|
||||
/// Gets whether or not libnotify is initialized.
|
||||
///
|
||||
/// # Example
|
||||
/// ```
|
||||
/// use libnotify_rs::api::functions::{init, is_initted};
|
||||
///
|
||||
/// fn main() -> Result<(), Box<dyn std::error::Error>> {
|
||||
/// if !is_initted() { // useful for conditional initing
|
||||
/// init("Test app")?;
|
||||
/// }
|
||||
///
|
||||
/// Ok(())
|
||||
/// }
|
||||
///
|
||||
/// ```
|
||||
pub fn is_initted() -> bool {
|
||||
unsafe { notify_is_initted() != 0 }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user