pub async fn print_label(&self) {
        if self.barcode_pdf_label.trim().is_empty() {
            // Return early.
            return;
        }
        let mut printer_url = env::var("PRINTER_URL").unwrap().trim_end_matches('/').to_string();
        printer_url = format!("{}/zebra", printer_url);
        let client = reqwest::Client::new();
        let resp = client
            .post(&printer_url)
            .body(
                json!(PrintLabelsRequest {
                    url: self.barcode_pdf_label.to_string(),
                    quantity: self.print_barcode_label_quantity
                })
                .to_string(),
            )
            .send()
            .await
            .unwrap();
        match resp.status() {
            StatusCode::ACCEPTED => (),
            s => {
                panic!("[print]: status_code: {}, body: {}", s, resp.text().await.unwrap());
            }
        };
    }
/// Send the label to our printer.
Send the label to our printer.
Send the label to our printer .
pub async fn print_label(&self) {
        if self.barcode_pdf_label.trim().is_empty() {
            // Return early.
            return;
        }
        let mut printer_url = env::var("PRINTER_URL").unwrap().trim_end_matches('/').to_string();
        printer_url = format!("{}/zebra", printer_url);
        let client = reqwest::Client::new();
        let resp = client
            .post(&printer_url)
            .body(
                json!(PrintLabelsRequest {
                    url: self.barcode_pdf_label.to_string(),
                    quantity: self.print_barcode_label_quantity
                })
                .to_string(),
            )
            .send()
            .await
            .unwrap();
        match resp.status() {
            StatusCode::ACCEPTED => (),
            s => {
                panic!("[print]: status_code: {}, body: {}", s, resp.text().await.unwrap());
            }
        };
    }
pub async fn print_label ( & self ) { if self . barcode_pdf_label . trim ( ) . is_empty ( ) { // Return early. return ; } let mut printer_url = env :: var ( " " ) . unwrap ( ) . trim_end_matches ( '/' ) . to_string ( ) ; printer_url = format ! ( " " printer_url ) ; let client = reqwest :: Client :: new ( ) ; let resp = client . post ( & printer_url ) . body ( json ! ( PrintLabelsRequest { url self barcode_pdf_label to_string ( ) quantity self print_barcode_label_quantity } ) . to_string ( ) , ) . send ( ) . await . unwrap ( ) ; match resp . status ( ) { StatusCode :: ACCEPTED => ( ) , s => { panic ! ( " " s resp text ( ) await unwrap ( ) ) ; } } ; }
Send the label to our printer.
Send the label to our printer .
&self
&self