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

IdleInhibitManager

Struct IdleInhibitManager 

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

Manages idle inhibitors and queries the global idle-inhibited state.

Implementations§

Source§

impl IdleInhibitManager

Source

pub fn new() -> Self

Create a new idle inhibit manager.

Source

pub fn create_inhibitor(&mut self, surface_id: u32) -> Result<u32, KernelError>

Create a new inhibitor for the specified surface.

Returns the inhibitor ID assigned by the manager.

Source

pub fn destroy_inhibitor(&mut self, id: u32) -> Result<(), KernelError>

Destroy an inhibitor by its object ID.

Source

pub fn remove_inhibitors_for_surface(&mut self, surface_id: u32) -> usize

Remove all inhibitors associated with a specific surface.

Called when a surface is destroyed to clean up its inhibitors. Returns the number of inhibitors removed.

Source

pub fn is_idle_inhibited(&self) -> bool

Check whether idle should be inhibited.

Returns true if at least one active inhibitor exists. In a full implementation, this would also check whether the inhibitor’s surface is currently visible/mapped.

Source

pub fn active_count(&self) -> usize

Get the number of active inhibitors.

Source

pub fn get_inhibitor(&self, id: u32) -> Option<&IdleInhibitor>

Get a reference to a specific inhibitor.

Source

pub fn inhibitor_count(&self) -> usize

Total number of inhibitors (active and inactive).

Trait Implementations§

Source§

impl Default for IdleInhibitManager

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

§

impl Freeze for IdleInhibitManager

§

impl RefUnwindSafe for IdleInhibitManager

§

impl Send for IdleInhibitManager

§

impl Sync for IdleInhibitManager

§

impl Unpin for IdleInhibitManager

§

impl UnwindSafe for IdleInhibitManager

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.