[][src]Crate ipp

IPP protocol implementation for Rust

Usage examples:

 // using raw API
 use ipp::{IppRequestResponse, IppClient};
 use ipp::consts::operation::Operation;

 let uri = "http://localhost:631/printers/test-printer";
 let req = IppRequestResponse::new(Operation::GetPrinterAttributes, uri);
 let client = IppClient::new(uri);
 if let Ok(resp) = client.send_request(req) {
     if resp.header().operation_status <= 3 {
         println!("result: {:?}", resp.attributes());
     }
 }
 // using operation API
 use ipp::{GetPrinterAttributes, IppClient};
 let operation = GetPrinterAttributes::new();
 let client = IppClient::new("http://localhost:631/printers/test-printer");
 if let Ok(attrs) = client.send(operation) {
     for (_, v) in attrs.get_printer_attributes().unwrap() {
         println!("{}: {}", v.name(), v.value());
     }
 }

Re-exports

pub use attribute::IppAttribute;
pub use attribute::IppAttributeList;
pub use client::IppClient;
pub use operation::CreateJob;
pub use operation::GetPrinterAttributes;
pub use operation::IppOperation;
pub use operation::PrintJob;
pub use operation::SendDocument;
pub use request::IppRequestResponse;
pub use value::IppValue;

Modules

attribute

Attribute-related structs

client

IPP client

consts

This module holds IPP constants such as attribute names, operations and tags

ffi

Interface functions to be called from other languages

operation

High-level IPP operation abstractions

parser

IPP stream parser

request

IPP request

server

Basic definitions for IPP server implementation

util

High-level utility functions to be used from external application or command-line utility

value

IPP value

Structs

IppHeader

IPP request and response header

Enums

IppError

IPP error

Constants

IPP_VERSION

Traits

ReadIppExt

Trait which adds two methods to Read implementations: read_string and read_vec

Type Definitions

Result