wick_oci_utils/
package.rs1mod pull;
2mod push;
3
4use std::path::PathBuf;
5
6pub use pull::*;
7pub use push::*;
8pub mod annotations;
10pub mod media_types;
12
13#[derive(Debug, Clone)]
15pub struct PackageFile {
16 package_path: PathBuf,
17 hash: String,
18 media_type: String,
19 contents: bytes::Bytes,
20}
21
22impl PackageFile {
23 pub fn new(package_path: PathBuf, hash: String, media_type: String, contents: bytes::Bytes) -> Self {
24 Self {
25 package_path,
26 hash,
27 media_type,
28 contents,
29 }
30 }
31
32 #[must_use]
34 pub const fn package_path(&self) -> &PathBuf {
35 &self.package_path
36 }
37
38 #[must_use]
40 pub fn hash(&self) -> &str {
41 &self.hash
42 }
43
44 #[must_use]
46 pub fn media_type(&self) -> &str {
47 &self.media_type
48 }
49
50 #[must_use]
52 pub fn contents(&self) -> &[u8] {
53 &self.contents
54 }
55
56 #[must_use]
58 #[allow(clippy::missing_const_for_fn)]
59 pub fn into_contents(self) -> bytes::Bytes {
60 self.contents
61 }
62}