pub struct LibnotifyContext {}Expand description
Notification context. Handles libnotify initializing and uninitializing.
Implementations§
Source§impl LibnotifyContext
impl LibnotifyContext
Sourcepub fn new(app_name: &str) -> Result<LibnotifyContext, Box<dyn Error>>
pub fn new(app_name: &str) -> Result<LibnotifyContext, Box<dyn Error>>
Try initializing libnotify
§Errors
Returns an error, if libnotify cannot be initialized or if there already exists a context object
§Example
use libnotify_rs::context::LibnotifyContext;
fn main() -> Result<(), Box<dyn std::error::Error>> {
let ctx = LibnotifyContext::new("Coffee addicted reminder")?;
// you don't need to uninitialize libnotify, cause context already does that!
Ok(())
}Sourcepub fn set_new_name(&self, app_name: &str) -> Result<(), LibnotifyError>
pub fn set_new_name(&self, app_name: &str) -> Result<(), LibnotifyError>
Sourcepub fn set_app_icon(&self, app_icon: &str) -> Result<(), LibnotifyError>
pub fn set_app_icon(&self, app_icon: &str) -> Result<(), LibnotifyError>
Trait Implementations§
Source§impl Drop for LibnotifyContext
impl Drop for LibnotifyContext
Auto Trait Implementations§
impl Freeze for LibnotifyContext
impl RefUnwindSafe for LibnotifyContext
impl Send for LibnotifyContext
impl Sync for LibnotifyContext
impl Unpin for LibnotifyContext
impl UnsafeUnpin for LibnotifyContext
impl UnwindSafe for LibnotifyContext
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more