pub(crate) struct Importer {
repo: Repo,
remote: Option<String>,
verify_text: Option<String>,
xattrs: HashMap<String, Variant>,
next_xattrs: Option<(String, String)>,
buf: Vec<u8>,
stats: ImportStats,
data: ImporterMode,
}Expand description
Importer machine.
Fields§
§repo: Repo§remote: Option<String>§verify_text: Option<String>§xattrs: HashMap<String, Variant>§next_xattrs: Option<(String, String)>§buf: Vec<u8>§stats: ImportStats§data: ImporterModeAdditional state depending on whether we’re importing an object set or a commit.
Implementations§
Source§impl Importer
impl Importer
Sourcepub(crate) fn new_for_commit(repo: &Repo, remote: Option<String>) -> Self
pub(crate) fn new_for_commit(repo: &Repo, remote: Option<String>) -> Self
Create an importer which will import an OSTree commit object.
Sourcepub(crate) fn new_for_object_set(repo: &Repo) -> Self
pub(crate) fn new_for_object_set(repo: &Repo) -> Self
Create an importer to write an “object set”; a chunk of objects which is usually streamed from a separate storage system, such as an OCI container image layer.
fn filter_entry<R: Read>( e: Entry<'_, R>, ) -> Result<Option<(Entry<'_, R>, Utf8PathBuf)>>
pub(crate) fn parse_metadata_entry( path: &Utf8Path, ) -> Result<(String, ObjectType)>
Sourcefn import_metadata<R: Read>(
&mut self,
entry: Entry<'_, R>,
checksum: &str,
objtype: ObjectType,
) -> Result<()>
fn import_metadata<R: Read>( &mut self, entry: Entry<'_, R>, checksum: &str, objtype: ObjectType, ) -> Result<()>
Import a metadata object.
Sourcefn import_large_regfile_object<R: Read>(
&mut self,
entry: Entry<'_, R>,
size: usize,
checksum: &str,
xattrs: Variant,
cancellable: Option<&Cancellable>,
) -> Result<()>
fn import_large_regfile_object<R: Read>( &mut self, entry: Entry<'_, R>, size: usize, checksum: &str, xattrs: Variant, cancellable: Option<&Cancellable>, ) -> Result<()>
Import a content object, large regular file flavour.
Sourcefn import_small_regfile_object<R: Read>(
&mut self,
entry: Entry<'_, R>,
size: usize,
checksum: &str,
xattrs: Variant,
cancellable: Option<&Cancellable>,
) -> Result<()>
fn import_small_regfile_object<R: Read>( &mut self, entry: Entry<'_, R>, size: usize, checksum: &str, xattrs: Variant, cancellable: Option<&Cancellable>, ) -> Result<()>
Import a content object, small regular file flavour.
Sourcefn import_symlink_object<R: Read>(
&mut self,
entry: Entry<'_, R>,
checksum: &str,
xattrs: Variant,
) -> Result<()>
fn import_symlink_object<R: Read>( &mut self, entry: Entry<'_, R>, checksum: &str, xattrs: Variant, ) -> Result<()>
Import a content object, symlink flavour.
Sourcefn import_content_object<R: Read>(
&mut self,
entry: Entry<'_, R>,
checksum: &str,
cancellable: Option<&Cancellable>,
) -> Result<()>
fn import_content_object<R: Read>( &mut self, entry: Entry<'_, R>, checksum: &str, cancellable: Option<&Cancellable>, ) -> Result<()>
Import a content object.
Sourcefn import_object<R: Read>(
&mut self,
entry: Entry<'_, R>,
path: &Utf8Path,
cancellable: Option<&Cancellable>,
) -> Result<()>
fn import_object<R: Read>( &mut self, entry: Entry<'_, R>, path: &Utf8Path, cancellable: Option<&Cancellable>, ) -> Result<()>
Given a tar entry that looks like an object (its path is under ostree/repo/objects/), determine its type and import it.
Sourcefn process_file_xattrs(
&mut self,
entry: Entry<'_, impl Read>,
checksum: String,
) -> Result<()>
fn process_file_xattrs( &mut self, entry: Entry<'_, impl Read>, checksum: String, ) -> Result<()>
Process a .file-xattrs object (v1).
Sourcefn process_file_xattrs_link(
&mut self,
entry: Entry<'_, impl Read>,
checksum: String,
) -> Result<()>
fn process_file_xattrs_link( &mut self, entry: Entry<'_, impl Read>, checksum: String, ) -> Result<()>
Process a .file-xattrs-link object (v1).
This is an hardlink that contains extended attributes for a content object. When the max hardlink count is reached, this object may also be encoded as a regular file instead.
Sourcefn process_xattr_ref<R: Read>(
&mut self,
entry: Entry<'_, R>,
target: String,
) -> Result<()>
fn process_xattr_ref<R: Read>( &mut self, entry: Entry<'_, R>, target: String, ) -> Result<()>
Process a .file.xattrs entry (v0).
This is an hardlink that contains extended attributes for a content object.
Sourcefn process_split_xattrs_content<R: Read>(
&mut self,
entry: Entry<'_, R>,
) -> Result<()>
fn process_split_xattrs_content<R: Read>( &mut self, entry: Entry<'_, R>, ) -> Result<()>
Process a special /xattrs/ entry, with checksum of xattrs content (v0).
Sourcefn cache_xattrs_content<R: Read>(
&mut self,
entry: Entry<'_, R>,
expected_checksum: Option<String>,
) -> Result<String>
fn cache_xattrs_content<R: Read>( &mut self, entry: Entry<'_, R>, expected_checksum: Option<String>, ) -> Result<String>
Read an xattrs entry and cache its content, optionally validating its checksum.
This returns the computed checksum for the successfully cached content.
fn import_objects_impl<'a>( &mut self, ents: impl Iterator<Item = Result<(Entry<'a, impl Read + Send + Unpin + 'a>, Utf8PathBuf)>>, cancellable: Option<&Cancellable>, ) -> Result<()>
pub(crate) fn import_objects( &mut self, archive: &mut Archive<impl Read + Send + Unpin>, cancellable: Option<&Cancellable>, ) -> Result<()>
pub(crate) fn import_commit( &mut self, archive: &mut Archive<impl Read + Send + Unpin>, cancellable: Option<&Cancellable>, ) -> Result<()>
pub(crate) fn finish_import_commit(self) -> (String, Option<String>)
pub(crate) fn default_dirmeta() -> Variant
pub(crate) fn finish_import_object_set(self) -> Result<String>
Auto Trait Implementations§
impl Freeze for Importer
impl RefUnwindSafe for Importer
impl Send for Importer
impl !Sync for Importer
impl Unpin for Importer
impl UnsafeUnpin for Importer
impl UnwindSafe for Importer
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