struct OstreeTarWriter<'a, W: Write> {
repo: &'a Repo,
commit_checksum: &'a str,
commit_object: Variant,
out: &'a mut Builder<W>,
options: ExportOptions,
wrote_initdirs: bool,
structure_only: bool,
wrote_vartmp: bool,
wrote_dirtree: HashSet<String>,
wrote_dirmeta: HashSet<String>,
wrote_content: HashSet<String>,
}Fields§
§repo: &'a Repo§commit_checksum: &'a str§commit_object: Variant§out: &'a mut Builder<W>§options: ExportOptions§wrote_initdirs: bool§structure_only: boolTrue if we’re only writing directories
wrote_vartmp: bool§wrote_dirtree: HashSet<String>§wrote_dirmeta: HashSet<String>§wrote_content: HashSet<String>Implementations§
Source§impl<'a, W: Write> OstreeTarWriter<'a, W>
impl<'a, W: Write> OstreeTarWriter<'a, W>
fn new( repo: &'a Repo, commit_checksum: &'a str, out: &'a mut Builder<W>, options: ExportOptions, ) -> Result<Self>
Sourcefn filter_mode(&self, mode: u32) -> u32
fn filter_mode(&self, mode: u32) -> u32
Convert the ostree mode to tar mode. The ostree mode bits include the format, tar does not. Historically in format version 0 we injected them, so we need to keep doing so.
Sourcefn append_default_dir(&mut self, path: &Utf8Path) -> Result<()>
fn append_default_dir(&mut self, path: &Utf8Path) -> Result<()>
Add a directory entry with default permissions (root/root 0755)
Sourcefn append_default_data(&mut self, path: &Utf8Path, buf: &[u8]) -> Result<()>
fn append_default_data(&mut self, path: &Utf8Path, buf: &[u8]) -> Result<()>
Add a regular file entry with default permissions (root/root 0644)
Sourcefn write_repo_structure(&mut self) -> Result<()>
fn write_repo_structure(&mut self) -> Result<()>
Write the initial /sysroot/ostree/repo structure.
Sourcefn write_commit(&mut self) -> Result<()>
fn write_commit(&mut self) -> Result<()>
Recursively serialize a commit object to the target tar stream.
fn append_commit_object(&mut self) -> Result<()>
fn append( &mut self, objtype: ObjectType, checksum: &str, v: &Variant, ) -> Result<()>
Sourcefn append_ostree_xattrs(
&mut self,
checksum: &str,
xattrs: &Variant,
) -> Result<bool>
fn append_ostree_xattrs( &mut self, checksum: &str, xattrs: &Variant, ) -> Result<bool>
Export xattrs in ostree-container style format, which is a .xattrs file. This is different from xattrs which may appear as e.g. PAX metadata, which we don’t use at the moment.
Return whether content was written.
Sourcefn append_tarstream_xattrs(&mut self, xattrs: &Variant) -> Result<()>
fn append_tarstream_xattrs(&mut self, xattrs: &Variant) -> Result<()>
Append all xattrs to the tar stream except security.selinux, because
that one doesn’t become visible in podman run anyways, so we couldn’t
rely on it in some cases.
https://github.com/containers/storage/blob/0d4a8d2aaf293c9f0464b888d932ab5147a284b9/pkg/archive/archive.go#L85
Sourcefn append_content(&mut self, checksum: &str) -> Result<(Utf8PathBuf, Header)>
fn append_content(&mut self, checksum: &str) -> Result<(Utf8PathBuf, Header)>
Write a content object, returning the path/header that should be used as a hard link to it in the target path. This matches how ostree checkouts work.
Sourcefn append_dir(&mut self, dirpath: &Utf8Path, meta: &DirMetaParsed) -> Result<()>
fn append_dir(&mut self, dirpath: &Utf8Path, meta: &DirMetaParsed) -> Result<()>
Write a directory using the provided metadata.
Sourcefn append_content_hardlink(
&mut self,
srcpath: &Utf8Path,
h: Header,
dest: &Utf8Path,
) -> Result<()>
fn append_content_hardlink( &mut self, srcpath: &Utf8Path, h: Header, dest: &Utf8Path, ) -> Result<()>
Given a source object (in e.g. ostree/repo/objects/…), write a hardlink to it
in its expected target path (e.g. usr/bin/bash).
Sourcefn append_dirtree<C: IsA<Cancellable>>(
&mut self,
dirpath: &Utf8Path,
checksum: String,
is_root: bool,
cancellable: Option<&C>,
) -> Result<()>
fn append_dirtree<C: IsA<Cancellable>>( &mut self, dirpath: &Utf8Path, checksum: String, is_root: bool, cancellable: Option<&C>, ) -> Result<()>
Write a dirtree object.
Sourcefn append_standard_var(
&mut self,
cancellable: Option<&Cancellable>,
) -> Result<()>
fn append_standard_var( &mut self, cancellable: Option<&Cancellable>, ) -> Result<()>
Generate e.g. /var/tmp.
In the OSTree model we expect /var to start out empty, and be populated via
e.g. systemd-tmpfiles. But, systemd doesn’t run in Docker-style containers by default.
So, this function creates a few critical directories in /var by default.
fn write_parents_of( &mut self, path: &Utf8Path, root: &File, cache: &mut HashSet<Utf8PathBuf>, ) -> Result<()>
Auto Trait Implementations§
impl<'a, W> Freeze for OstreeTarWriter<'a, W>
impl<'a, W> RefUnwindSafe for OstreeTarWriter<'a, W>where
W: RefUnwindSafe,
impl<'a, W> !Send for OstreeTarWriter<'a, W>
impl<'a, W> !Sync for OstreeTarWriter<'a, W>
impl<'a, W> Unpin for OstreeTarWriter<'a, W>
impl<'a, W> !UnwindSafe for OstreeTarWriter<'a, W>
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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>
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>
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§impl<D> OwoColorize for D
impl<D> OwoColorize for D
§fn fg<C>(&self) -> FgColorDisplay<'_, C, Self>where
C: Color,
fn fg<C>(&self) -> FgColorDisplay<'_, C, Self>where
C: Color,
§fn bg<C>(&self) -> BgColorDisplay<'_, C, Self>where
C: Color,
fn bg<C>(&self) -> BgColorDisplay<'_, C, Self>where
C: Color,
§fn on_magenta(&self) -> BgColorDisplay<'_, Magenta, Self>
fn on_magenta(&self) -> BgColorDisplay<'_, Magenta, Self>
§fn default_color(&self) -> FgColorDisplay<'_, Default, Self>
fn default_color(&self) -> FgColorDisplay<'_, Default, Self>
§fn on_default_color(&self) -> BgColorDisplay<'_, Default, Self>
fn on_default_color(&self) -> BgColorDisplay<'_, Default, Self>
§fn bright_black(&self) -> FgColorDisplay<'_, BrightBlack, Self>
fn bright_black(&self) -> FgColorDisplay<'_, BrightBlack, Self>
§fn on_bright_black(&self) -> BgColorDisplay<'_, BrightBlack, Self>
fn on_bright_black(&self) -> BgColorDisplay<'_, BrightBlack, Self>
§fn bright_red(&self) -> FgColorDisplay<'_, BrightRed, Self>
fn bright_red(&self) -> FgColorDisplay<'_, BrightRed, Self>
§fn on_bright_red(&self) -> BgColorDisplay<'_, BrightRed, Self>
fn on_bright_red(&self) -> BgColorDisplay<'_, BrightRed, Self>
§fn bright_green(&self) -> FgColorDisplay<'_, BrightGreen, Self>
fn bright_green(&self) -> FgColorDisplay<'_, BrightGreen, Self>
§fn on_bright_green(&self) -> BgColorDisplay<'_, BrightGreen, Self>
fn on_bright_green(&self) -> BgColorDisplay<'_, BrightGreen, Self>
§fn bright_yellow(&self) -> FgColorDisplay<'_, BrightYellow, Self>
fn bright_yellow(&self) -> FgColorDisplay<'_, BrightYellow, Self>
§fn on_bright_yellow(&self) -> BgColorDisplay<'_, BrightYellow, Self>
fn on_bright_yellow(&self) -> BgColorDisplay<'_, BrightYellow, Self>
§fn bright_blue(&self) -> FgColorDisplay<'_, BrightBlue, Self>
fn bright_blue(&self) -> FgColorDisplay<'_, BrightBlue, Self>
§fn on_bright_blue(&self) -> BgColorDisplay<'_, BrightBlue, Self>
fn on_bright_blue(&self) -> BgColorDisplay<'_, BrightBlue, Self>
§fn bright_magenta(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
fn bright_magenta(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
§fn on_bright_magenta(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
fn on_bright_magenta(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
§fn bright_purple(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
fn bright_purple(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
§fn on_bright_purple(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
fn on_bright_purple(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
§fn bright_cyan(&self) -> FgColorDisplay<'_, BrightCyan, Self>
fn bright_cyan(&self) -> FgColorDisplay<'_, BrightCyan, Self>
§fn on_bright_cyan(&self) -> BgColorDisplay<'_, BrightCyan, Self>
fn on_bright_cyan(&self) -> BgColorDisplay<'_, BrightCyan, Self>
§fn bright_white(&self) -> FgColorDisplay<'_, BrightWhite, Self>
fn bright_white(&self) -> FgColorDisplay<'_, BrightWhite, Self>
§fn on_bright_white(&self) -> BgColorDisplay<'_, BrightWhite, Self>
fn on_bright_white(&self) -> BgColorDisplay<'_, BrightWhite, Self>
§fn blink_fast(&self) -> BlinkFastDisplay<'_, Self>
fn blink_fast(&self) -> BlinkFastDisplay<'_, Self>
§fn strikethrough(&self) -> StrikeThroughDisplay<'_, Self>
fn strikethrough(&self) -> StrikeThroughDisplay<'_, Self>
§fn color<Color>(&self, color: Color) -> FgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
fn color<Color>(&self, color: Color) -> FgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
OwoColorize::fg] or
a color-specific method, such as [OwoColorize::green], Read more§fn on_color<Color>(&self, color: Color) -> BgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
fn on_color<Color>(&self, color: Color) -> BgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
OwoColorize::bg] or
a color-specific method, such as [OwoColorize::on_yellow], Read more