⚠️ VeridianOS Kernel Documentation - This is low-level kernel code. All functions are unsafe unless explicitly marked otherwise. no_std

NotificationManager

Struct NotificationManager 

Source
pub struct NotificationManager { /* private fields */ }
Expand description

Manages the set of active desktop notifications.

Implementations§

Source§

impl NotificationManager

Source

pub fn new(screen_width: usize, screen_height: usize) -> Self

Create a new notification manager positioned in the top-right corner.

Source

pub fn notify( &mut self, summary: String, body: String, urgency: NotificationUrgency, app_name: String, ) -> u32

Post a new notification. Returns the assigned notification ID.

Source

pub fn dismiss(&mut self, id: u32)

Dismiss a specific notification by ID.

Source

pub fn dismiss_all(&mut self)

Dismiss all active notifications.

Source

pub fn tick(&mut self, current_tick: u64)

Tick the notification manager: remove expired and dismissed entries.

Source

pub fn visible_notifications(&self) -> Vec<&Notification>

Return references to the currently visible (non-dismissed, non-expired) notifications, up to max_visible.

Source

pub fn active_count(&self) -> usize

Return total count of active (non-dismissed, non-expired) notifications.

Source

pub fn render_to_buffer( &self, buffer: &mut [u32], buf_width: usize, buf_height: usize, current_tick: u64, )

Render all visible toast notifications into a u32 pixel buffer.

The buffer is buf_width * buf_height pixels in BGRA format (one u32 per pixel). Toasts are rendered from the top-right corner, stacking downward. Only pixels belonging to toast rectangles are written; the caller is responsible for compositing this buffer as an overlay.

Auto Trait Implementations§

§

impl Freeze for NotificationManager

§

impl RefUnwindSafe for NotificationManager

§

impl Send for NotificationManager

§

impl Sync for NotificationManager

§

impl Unpin for NotificationManager

§

impl UnwindSafe for NotificationManager

Blanket Implementations§

§

impl<T> Any for T
where T: 'static + ?Sized,

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Borrow<T> for T
where T: ?Sized,

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

impl<T> BorrowMut<T> for T
where T: ?Sized,

§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T, U> Into<U> for T
where U: From<T>,

§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of [From]<T> for U chooses to do.

§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.