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

PrintQueue

Struct PrintQueue 

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

A queue of print jobs for a single printer.

Implementations§

Source§

impl PrintQueue

Source

pub fn new(max_jobs: usize) -> Self

Create a new queue with the given capacity.

Source

pub fn enqueue(&mut self, job: PrintJob) -> bool

Enqueue a job. Returns false if the queue is full.

Source

pub fn dequeue(&mut self) -> Option<PrintJob>

Dequeue the next job (FIFO).

Source

pub fn cancel(&mut self, job_id: PrintJobId) -> bool

Cancel a job by ID. Returns true if found and cancelled.

Source

pub fn get_status(&self, job_id: PrintJobId) -> Option<PrintJobStatus>

Get the status of a specific job.

Source

pub fn pending_count(&self) -> usize

Number of jobs currently in the queue.

Source

pub fn total_count(&self) -> usize

Total number of jobs in the queue (all statuses).

Source

pub fn complete_job(&mut self, job_id: PrintJobId) -> bool

Mark a job as completed and update stats.

Source

pub fn purge_finished(&mut self)

Remove completed and cancelled jobs from the queue.

Trait Implementations§

Source§

impl Debug for PrintQueue

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl Freeze for PrintQueue

§

impl RefUnwindSafe for PrintQueue

§

impl Send for PrintQueue

§

impl Sync for PrintQueue

§

impl Unpin for PrintQueue

§

impl UnwindSafe for PrintQueue

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.