1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
//! Shared core for grabcli: the parts every Grab service reuses — config,
//! session, auth/hydra, the allowlisted HTTP client, the read-only response
//! cache and money helpers.
//!
//! The library owns no storage and reads no files or environment: an
//! embedder builds a [`Context`] with [`Context::new`]`(config, session_store,
//! cache)`, passing an `Arc<dyn` [`SessionStore`]`>` and an `Arc<dyn`
//! [`Cache`]`>`. The `grab` CLI uses a `session.json` file store and the
//! SQLite cache from `grabcli-sqlite`; a daemon can back both with its own
//! database. Service crates (e.g. `grabfood`) register their URL allowlist
//! and make calls through the context.
//!
//! # Example: format a price
//!
//! ```
//! use grabcli_core::Money;
//!
//! let price = Money(12_345); // integer centavos, not floating-point pesos
//! assert_eq!(price.peso(), "₱123.45");
//! assert_eq!(price.minor(), 12_345);
//! ```
//!
//! For HTTP calls, construct a [`Context`] with your own [`SessionStore`] and
//! [`Cache`]; see `grabfood::context` or `grabcli-service` for service-level setup.
pub use ;
pub use Config;
pub use Context;
pub use ;
pub use ;
pub use Location;
pub use Money;
pub use Session;
pub use ;
/// Package README examples, compiled as doctests.
;