2 unstable releases

0.2.0 Nov 14, 2023
0.1.0 Jul 8, 2021

#337 in Caching

33 downloads per month

MIT license

35KB
676 lines

portier-rs

crates.io Released API docs

A Portier client library for Rust.


lib.rs:

A client for the Portier protocol.

The primary interface of this package is the Client. Construct one using Client::builder or Client::new. See also the short example using the Rocket framework in example/src/main.rs.

Some data storage is needed to implement the protocol. This is used for tracking short-lived login sessions, and caching of basic HTTP GET requests. The Store trait facilitates this, and by default, an in-memory store is used. This will work fine for simple single-process applications, but if you intend to run multiple workers, an alternative Store must be implemented. (In the future, we may offer some alternatives for common databases. Contributions are welcome!)

Some applications may need multiple configurations and Client instances, for example because they serve multiple domains. In this case, we recommended creating short-lived Clients and sharing the Store between them.

The crate feature simple-store is enabled by default, but can be disabled to remove the Tokio and Hyper dependencies. When disabled, the default MemoryStore will also not be available, and a custom Store implementation must be provided.

The minimum required Rust version is 1.46.

Dependencies

~8–21MB
~413K SLoC