mirror of
https://github.com/edera-dev/krata.git
synced 2025-08-04 05:31:32 +00:00
feat: oci tar format, bit-perfect disk storage for config and manifest, concurrent image pulls (#88)
* oci: retain bit-perfect copies of manifest and config on disk * feat: oci tar format support * feat: concurrent image pulls
This commit is contained in:
29
crates/oci/src/schema.rs
Normal file
29
crates/oci/src/schema.rs
Normal file
@ -0,0 +1,29 @@
|
||||
use std::fmt::Debug;
|
||||
|
||||
#[derive(Clone, Debug)]
|
||||
pub struct OciSchema<T: Clone + Debug> {
|
||||
raw: Vec<u8>,
|
||||
item: T,
|
||||
}
|
||||
|
||||
impl<T: Clone + Debug> OciSchema<T> {
|
||||
pub fn new(raw: Vec<u8>, item: T) -> OciSchema<T> {
|
||||
OciSchema { raw, item }
|
||||
}
|
||||
|
||||
pub fn raw(&self) -> &[u8] {
|
||||
&self.raw
|
||||
}
|
||||
|
||||
pub fn item(&self) -> &T {
|
||||
&self.item
|
||||
}
|
||||
|
||||
pub fn into_raw(self) -> Vec<u8> {
|
||||
self.raw
|
||||
}
|
||||
|
||||
pub fn into_item(self) -> T {
|
||||
self.item
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user