Skip to content

Commit

Permalink
add printer new
Browse files Browse the repository at this point in the history
  • Loading branch information
tuna-f1sh committed Dec 6, 2024
1 parent c2b2998 commit 980b993
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/function/printer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ bitflags! {
}
}

/// Builder for USB human interface device (PRINTER) function.
/// Builder for USB printer function.
#[derive(Debug, Clone)]
#[non_exhaustive]
pub struct PrinterBuilder {
Expand Down Expand Up @@ -78,18 +78,23 @@ impl Function for PrinterFunction {
}
}

/// USB human interface device (PRINTER) function.
/// USB printer function.
#[derive(Debug)]
pub struct Printer {
dir: FunctionDir,
}

impl Printer {
/// Creates a new USB human interface device (PRINTER) builder.
/// Creates a new USB printer builder.
pub fn builder() -> PrinterBuilder {
PrinterBuilder { pnp_string: None, qlen: None }
}

/// Creates a new USB printer function and handle with f_printer defaults
pub fn new(self) -> (Printer, Handle) {
Self::builder().build()
}

/// Access to registration status.
pub fn status(&self) -> Status {
self.dir.status()
Expand Down

0 comments on commit 980b993

Please sign in to comment.