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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
//! Shared library entry points for the `truss` project.
//!
//! # The public API
//!
//! What this page lists is the API. Nothing else in the crate is, and the sections below
//! say what that means for a version number.
//!
//! While the version is `0.x`, a minor release may change any of it. From `1.0` on, the
//! shape here is what semantic versioning covers: adding an export or a field to a
//! `#[non_exhaustive]` type is a minor release, removing or renaming an export is a major
//! one, and the minimum supported Rust version in `Cargo.toml` is raised only in a minor
//! release. This page is the Rust crate's half of the promise. The other surfaces state
//! their own half beside what they specify: the CLI's subcommands, flags, and exit codes in
//! [`docs/problems.md`], the HTTP server's routes, query vocabulary, and headers in
//! [`docs/api-reference.md`], and each npm package's exports and option keys in its own
//! README. The signed URL format is older than all of them and carries a stronger promise,
//! in [`docs/signed-url-spec.md`], which holds even before `1.0`.
//!
//! [`docs/problems.md`]: https://github.com/nao1215/truss/blob/main/docs/problems.md#compatibility
//! [`docs/api-reference.md`]: https://github.com/nao1215/truss/blob/main/docs/api-reference.md#compatibility
//! [`docs/signed-url-spec.md`]: https://github.com/nao1215/truss/blob/main/docs/signed-url-spec.md#compatibility-policy
//!
//! Everything the crate exports is re-exported here, at the root. The module tree is
//! private, so a path through it is not part of the API and does not compile:
//!
//! ```compile_fail
//! use truss::core::TransformOptions;
//! ```
//!
//! The types that grow as truss grows are `#[non_exhaustive]`, so a field a later version
//! adds is a minor change rather than a breaking one. A caller starts from `default()`, or
//! from a constructor, and assigns:
//!
//! ```compile_fail
//! use truss::TransformOptions;
//!
//! let options = TransformOptions { width: Some(800), ..TransformOptions::default() };
//! ```
//!
//! ```
//! use truss::TransformOptions;
//!
//! let mut options = TransformOptions::default();
//! options.width = Some(800);
//! assert_eq!(options.width, Some(800));
//! ```
//!
//! The value types are exhaustive on purpose, because none of them can gain a field without
//! becoming a different idea: a rectangle is four numbers, a colour is four channels, a size
//! is two, and a quality target is a metric and a threshold. Their literals and their
//! patterns keep working.
//!
//! ```
//! use truss::{CropRegion, Dimensions, Rgba8};
//!
//! let region = CropRegion { x: 0, y: 0, width: 10, height: 10 };
//! let colour = Rgba8 { r: 1, g: 2, b: 3, a: 255 };
//! let size = Dimensions::new(10, 10);
//! assert_eq!((region.width, colour.a, size.height), (10, 255, 10));
//! ```
// The module tree is private and the `pub use` block below is the API. Publishing the
// modules made every `pub` item under them reachable, which was 124 items to advertise 55,
// and a 1.0 freezes whatever is reachable rather than whatever was meant.
pub use run as run_cli;
pub use StorageBackend;
pub use ;
pub use ;
pub use ;
pub use ;
pub use transform;
pub use ;