Add Notification::set_category()

This commit is contained in:
Julian Ospald 2017-07-09 19:30:49 +02:00
parent a52c50a318
commit c2efdd0842
No known key found for this signature in database
GPG Key ID: 511B62C09D50CD28

View File

@ -286,6 +286,18 @@ impl<'a> Notification<'a> {
return Ok(());
}
/// Sets the category of this notification. This can be used by the
/// notification server to filter or display the data in a certain way.
pub fn set_category(&self, category: &str) -> Result<(), NotificationCreationError> {
let category = try!(CString::new(category));
unsafe {
sys::notify_notification_set_category(self.handle,
category.as_ptr());
}
return Ok(());
}
}