docs: add doctest to notification::show

This commit is contained in:
2026-10-04 15:01:33 +02:00
parent c231911f6b
commit 8172a5f9fb

View File

@@ -419,6 +419,27 @@ impl<'a> Notification {
///
/// # Errors
/// This function can return LibnotifyError::{GerrorError, AllocationError}
///
/// # Example
/// ```no_run(No notification daemon on CI)
/// use libnotify_rs::api::{
/// functions::{init, uninit},
/// notification::{self, Notification},
/// };
///
/// fn main() -> Result<(), Box<dyn std::error::Error>> {
/// init("I love coffee")?;
/// let mut notify = Notification::new(
/// "Remember to drink coffe!",
/// "Coffee is very important for your mental health!",
/// None,
/// )?;
///
/// notify.show()?;
///
/// Ok(())
/// }
/// ```
pub fn show(&self) -> Result<(), LibnotifyError> {
let mut gerror = std::ptr::null_mut() as *mut GError;