22 releases (stable)

new 5.1.0 Nov 10, 2024
5.0.4 Aug 24, 2024
5.0.3 Feb 1, 2024
5.0.2 Dec 16, 2023
0.0.3 Sep 22, 2016

#151 in Network programming

Download history 68/week @ 2024-07-27 83/week @ 2024-08-03 36/week @ 2024-08-10 74/week @ 2024-08-17 226/week @ 2024-08-24 207/week @ 2024-08-31 163/week @ 2024-09-07 96/week @ 2024-09-14 182/week @ 2024-09-21 187/week @ 2024-09-28 157/week @ 2024-10-05 109/week @ 2024-10-12 281/week @ 2024-10-19 197/week @ 2024-10-26 165/week @ 2024-11-02 299/week @ 2024-11-09

952 downloads per month
Used in 2 crates

MIT/Apache

130KB
3K SLoC

ipp.rs

github actions crates license license docs.rs

IPP protocol implementation for Rust. This crate implements IPP protocol as defined in RFC 8010, RFC 8011.

It supports both synchronous and asynchronous operations (requests and responses) which is controlled by the async feature flag.

The following build-time features are supported:

  • async - enables asynchronous APIs.
  • async-client - enables asynchronous IPP client based on reqwest crate, implies async feature.
  • client - enables blocking IPP client based on ureq crate.
  • async-client-tls - enables asynchronous IPP client with TLS, using native-tls backend. Implies async-client feature.
  • client-tls - enables blocking IPP client with TLS, using native-tls backend. Implies client feature.
  • async-client-rustls - enables asynchronous IPP client with TLS, using rustls backend. Implies async-client feature.
  • client-rustls - enables blocking IPP client with TLS, using rustls backend. Implies client feature.

By default, the following features are enabled: async-client-tls. Use default-features=false dependency option to disable them.

Documentation

Usage example for async client:

use ipp::prelude::*;

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    let uri: Uri = "http://localhost:631/printers/test-printer".parse()?;
    let operation = IppOperationBuilder::get_printer_attributes(uri.clone()).build();
    let client = AsyncIppClient::new(uri);
    let resp = client.send(operation).await?;
    if resp.header().status_code().is_success() {
        let printer_attrs = resp
            .attributes()
            .groups_of(DelimiterTag::PrinterAttributes)
            .next()
            .unwrap();
        for (_, v) in printer_attrs.attributes() {
            println!("{}: {}", v.name(), v.value());
        }
    }
    Ok(())
}

For more usage examples please check the examples folder.

License

Licensed under MIT or Apache license (LICENSE-MIT or LICENSE-APACHE)

Dependencies

~1–15MB
~224K SLoC