pub struct ChangeSet { /* private fields */ }
Implementations§
Source§impl ChangeSet
impl ChangeSet
Sourcepub fn new<P: AsRef<Path>>(
source_dir: P,
dest_dir: P,
items: Vec<Change>,
) -> Self
pub fn new<P: AsRef<Path>>( source_dir: P, dest_dir: P, items: Vec<Change>, ) -> Self
Create a new set of snapshot changes
Sourcepub fn write_layer<P: AsRef<Path>>(
self,
layout_dir: P,
media_type: &MediaType,
) -> Result<(String, Descriptor)>
pub fn write_layer<P: AsRef<Path>>( self, layout_dir: P, media_type: &MediaType, ) -> Result<(String, Descriptor)>
Creates an OCI layer for the set of changes
This implements the Representing Changes section of the OCI image spec:
Added
andModified
paths are added to the archive.Removed
paths are represented as “whiteout” files.
Note that two SHA256 hashes are calculated, one for the DiffID
of a changeset (calculated in this function
and used in the image config file) and one for the digest which (calculated by the [BlobWriter
] and used in the image manifest).
A useful diagram showing how these are calculated and used is available
here.
§Arguments
layout_dir
: the image directory to write the layer to (to theblob/sha256
subdirectory)
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ChangeSet
impl RefUnwindSafe for ChangeSet
impl Send for ChangeSet
impl Sync for ChangeSet
impl Unpin for ChangeSet
impl UnwindSafe for ChangeSet
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more