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
//! `docker save` archives on the host, by their absolute path.
use Path;
use crate::;
/// A `docker save` archive on the host, by its absolute path.
///
/// Other crates get one from [`Image::parse`](super::Image::parse) alone, which checks that the
/// path is absolute. The path is kept exactly as given, and the file need not exist.
///
/// # Examples
///
/// ```
/// use moonmchn::image::Image;
///
/// let Image::Archive(archive) = Image::parse("/images/guest.tar").unwrap() else {
/// unreachable!("an absolute path is an archive");
/// };
/// assert_eq!(archive.as_str(), "/images/guest.tar");
///
/// // The engine would resolve a relative path against the daemon's working directory.
/// assert!(Image::parse("./guest.tar").is_err());
/// ```
;