pub struct PrintBackendProxy<'p>(/* private fields */);zbus-backend only.Expand description
Low-level proxy for org.openprinting.PrintBackend.
Prefer CpdbClient for high-level usage.
Implementations§
Source§impl<'p> PrintBackendProxy<'p>
impl<'p> PrintBackendProxy<'p>
Sourcepub async fn new(conn: &Connection) -> Result<PrintBackendProxy<'p>>
pub async fn new(conn: &Connection) -> Result<PrintBackendProxy<'p>>
Creates a new proxy with the default service and path.
Sourcepub fn builder(conn: &Connection) -> Builder<'p, Self>
pub fn builder(conn: &Connection) -> Builder<'p, Self>
Returns a customizable builder for this proxy.
Sourcepub fn into_inner(self) -> Proxy<'p>
pub fn into_inner(self) -> Proxy<'p>
Consumes self, returning the underlying zbus::Proxy.
Sourcepub fn inner_mut(&mut self) -> &mut Proxy<'p>
pub fn inner_mut(&mut self) -> &mut Proxy<'p>
The mutable reference to the underlying zbus::Proxy.
Sourcepub async fn get_all_printers(&self) -> Result<(i32, Vec<(OwnedValue,)>)>
pub async fn get_all_printers(&self) -> Result<(i32, Vec<(OwnedValue,)>)>
Returns all printers known to this backend.
Sourcepub async fn get_backend_name(&self) -> Result<String>
pub async fn get_backend_name(&self) -> Result<String>
Returns the backend name (e.g. “CUPS”, “FILE”).
Sourcepub async fn get_filtered_printer_list(
&self,
) -> Result<(i32, Vec<(OwnedValue,)>)>
pub async fn get_filtered_printer_list( &self, ) -> Result<(i32, Vec<(OwnedValue,)>)>
Returns printers matching the current filter settings.
Sourcepub async fn do_listing(&self, is_listed: bool) -> Result<()>
pub async fn do_listing(&self, is_listed: bool) -> Result<()>
Starts or stops printer discovery. Call do_listing(true) to trigger
PrinterAdded signals for all known printers.
This is a fire-and-forget method - the backend does not send a reply.
Sourcepub async fn get_all_options(
&self,
printer_id: &str,
) -> Result<(i32, Vec<RawOption>, i32, Vec<RawMedia>)>
pub async fn get_all_options( &self, printer_id: &str, ) -> Result<(i32, Vec<RawOption>, i32, Vec<RawMedia>)>
Fetches all options and media for a printer in a single call.
Returns (num_options, options, num_media, media).
This is the primary method for getting printer capabilities.
Sourcepub async fn get_all_translations(
&self,
printer_id: &str,
locale: &str,
) -> Result<HashMap<String, String>>
pub async fn get_all_translations( &self, printer_id: &str, locale: &str, ) -> Result<HashMap<String, String>>
Fetches all localized translations for a printer’s options.
Returns a map of internal name -> human-readable label.
Sourcepub async fn get_default_printer(&self) -> Result<String>
pub async fn get_default_printer(&self) -> Result<String>
Returns the default printer ID for this backend.
Sourcepub async fn get_printer_state(&self, printer_id: &str) -> Result<String>
pub async fn get_printer_state(&self, printer_id: &str) -> Result<String>
Returns the current state of a printer (e.g. “idle”, “printing”).
Sourcepub async fn is_accepting_jobs(&self, printer_id: &str) -> Result<bool>
pub async fn is_accepting_jobs(&self, printer_id: &str) -> Result<bool>
Returns whether a printer is currently accepting jobs.
Sourcepub async fn get_option_translation(
&self,
printer_name: &str,
option_name: &str,
locale: &str,
) -> Result<String>
pub async fn get_option_translation( &self, printer_name: &str, option_name: &str, locale: &str, ) -> Result<String>
Returns a localized label for a single option name.
Sourcepub async fn get_choice_translation(
&self,
printer_name: &str,
option_name: &str,
choice_name: &str,
locale: &str,
) -> Result<String>
pub async fn get_choice_translation( &self, printer_name: &str, option_name: &str, choice_name: &str, locale: &str, ) -> Result<String>
Returns a localized label for a single option choice.
Sourcepub async fn get_group_translation(
&self,
printer_name: &str,
group_name: &str,
locale: &str,
) -> Result<String>
pub async fn get_group_translation( &self, printer_name: &str, group_name: &str, locale: &str, ) -> Result<String>
Returns a localized label for an option group.
Sourcepub async fn print_fd(
&self,
printer_id: &str,
num_settings: i32,
settings: &[(&str, &str)],
title: &str,
) -> Result<(String, OwnedFd)>
pub async fn print_fd( &self, printer_id: &str, num_settings: i32, settings: &[(&str, &str)], title: &str, ) -> Result<(String, OwnedFd)>
Submits a print job and returns a writable file descriptor.
The backend creates a job and returns the write end of a socketpair.
The caller writes document data into fd and closes it when done.
Sourcepub async fn print_socket(
&self,
printer_id: &str,
num_settings: i32,
settings: &[(&str, &str)],
title: &str,
) -> Result<(String, String)>
pub async fn print_socket( &self, printer_id: &str, num_settings: i32, settings: &[(&str, &str)], title: &str, ) -> Result<(String, String)>
Submits a print job via a Unix socket path.
Sourcepub async fn show_remote_printers(&self, is_visible: bool) -> Result<()>
pub async fn show_remote_printers(&self, is_visible: bool) -> Result<()>
Show or hide remote (network-discovered) printers.
This is a fire-and-forget method. The backend will emit PrinterRemoved
or PrinterAdded signals to reflect the new filtered state.
Sourcepub async fn show_temporary_printers(&self, is_visible: bool) -> Result<()>
pub async fn show_temporary_printers(&self, is_visible: bool) -> Result<()>
Show or hide temporary (auto-discovered) printers.
Sourcepub async fn keep_alive(&self) -> Result<()>
pub async fn keep_alive(&self) -> Result<()>
Keeps the backend alive (prevents auto-exit timeout).
Sourcepub async fn replace(&self, previous_dialog_id: &str) -> Result<()>
pub async fn replace(&self, previous_dialog_id: &str) -> Result<()>
Tells the backend to replace state from a previous dialog session.
Sourcepub async fn ping(&self, printer_id: &str) -> Result<()>
pub async fn ping(&self, printer_id: &str) -> Result<()>
Ping (testing only, will be removed from spec).
Sourcepub async fn receive_printer_added(&self) -> Result<PrinterAddedStream>
pub async fn receive_printer_added(&self) -> Result<PrinterAddedStream>
Create a stream that receives PrinterAdded signals.
This a convenient wrapper around zbus::Proxy::receive_signal.
Emitted when a new printer is discovered by this backend.
Sourcepub async fn receive_printer_added_with_args(
&self,
args: &[(u8, &str)],
) -> Result<PrinterAddedStream>
pub async fn receive_printer_added_with_args( &self, args: &[(u8, &str)], ) -> Result<PrinterAddedStream>
Create a stream that receives PrinterAdded signals.
This a convenient wrapper around zbus::Proxy::receive_signal_with_args.
Emitted when a new printer is discovered by this backend.
Sourcepub async fn receive_printer_removed(&self) -> Result<PrinterRemovedStream>
pub async fn receive_printer_removed(&self) -> Result<PrinterRemovedStream>
Create a stream that receives PrinterRemoved signals.
This a convenient wrapper around zbus::Proxy::receive_signal.
Emitted when a printer is removed from this backend.
Sourcepub async fn receive_printer_removed_with_args(
&self,
args: &[(u8, &str)],
) -> Result<PrinterRemovedStream>
pub async fn receive_printer_removed_with_args( &self, args: &[(u8, &str)], ) -> Result<PrinterRemovedStream>
Create a stream that receives PrinterRemoved signals.
This a convenient wrapper around zbus::Proxy::receive_signal_with_args.
Emitted when a printer is removed from this backend.
Sourcepub async fn receive_printer_state_changed(
&self,
) -> Result<PrinterStateChangedStream>
pub async fn receive_printer_state_changed( &self, ) -> Result<PrinterStateChangedStream>
Create a stream that receives PrinterStateChanged signals.
This a convenient wrapper around zbus::Proxy::receive_signal.
Emitted when a printer’s state changes (e.g. idle -> printing).
Sourcepub async fn receive_printer_state_changed_with_args(
&self,
args: &[(u8, &str)],
) -> Result<PrinterStateChangedStream>
pub async fn receive_printer_state_changed_with_args( &self, args: &[(u8, &str)], ) -> Result<PrinterStateChangedStream>
Create a stream that receives PrinterStateChanged signals.
This a convenient wrapper around zbus::Proxy::receive_signal_with_args.
Emitted when a printer’s state changes (e.g. idle -> printing).
Trait Implementations§
Source§impl<'p> AsMut<Proxy<'p>> for PrintBackendProxy<'p>
impl<'p> AsMut<Proxy<'p>> for PrintBackendProxy<'p>
Source§impl<'p> AsRef<Proxy<'p>> for PrintBackendProxy<'p>
impl<'p> AsRef<Proxy<'p>> for PrintBackendProxy<'p>
Source§impl<'p> Clone for PrintBackendProxy<'p>
impl<'p> Clone for PrintBackendProxy<'p>
Source§fn clone(&self) -> PrintBackendProxy<'p>
fn clone(&self) -> PrintBackendProxy<'p>
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more