Struct debian_packaging::repository::copier::RepositoryCopier
source · [−]pub struct RepositoryCopier { /* private fields */ }Expand description
Entity for copying Debian repository content.
Instances of this type can be used to copy select Debian repository content between a reader and a writer.
The file layout and content is preserved, so existing PGP signatures can be preserved. However, the copier does have the ability to selectively filter which files are copied. So the destination repository may reference content that doesn’t exist in that location.
Because repositories do not have a standardized mechanism for discovering dists/releases within, this type must be told which distributions to copy. Copying is performed 1 distribution at a time.
By default, instances copy all copyable content. Installer files are currently not supported. Incomplete copies for all other files is considered a bug and should be reported.
Various set_* methods exist to control the copying behavior.
Implementations
sourceimpl RepositoryCopier
impl RepositoryCopier
sourcepub fn set_only_components(&mut self, components: impl Iterator<Item = String>)
pub fn set_only_components(&mut self, components: impl Iterator<Item = String>)
Set an explicit list of components whose files to copy.
sourcepub fn set_binary_packages_copy(&mut self, value: bool)
pub fn set_binary_packages_copy(&mut self, value: bool)
Set whether to copy non-installer binary packages.
sourcepub fn set_binary_packages_only_arches(
&mut self,
value: impl Iterator<Item = String>
)
pub fn set_binary_packages_only_arches(
&mut self,
value: impl Iterator<Item = String>
)
Set a filter for architectures of non-installer binary packages to copy.
Binary packages for architectures not in this set will be ignored.
sourcepub fn set_installer_binary_packages_copy(&mut self, value: bool)
pub fn set_installer_binary_packages_copy(&mut self, value: bool)
Set whether to copy installer binary packages.
sourcepub fn set_installer_binary_packages_only_arches(
&mut self,
value: impl Iterator<Item = String>
)
pub fn set_installer_binary_packages_only_arches(
&mut self,
value: impl Iterator<Item = String>
)
Set a filter for architectures of installer binary packages to copy.
Binary packages for architectures not in this set will be ignored.
sourcepub fn set_sources_copy(&mut self, value: bool)
pub fn set_sources_copy(&mut self, value: bool)
Set whether to copy sources package files.
sourcepub async fn copy_from_config(
config: RepositoryCopierConfig,
max_copy_operations: usize,
progress_cb: &Option<Box<dyn Fn(PublishEvent) + Sync>>
) -> Result<()>
pub async fn copy_from_config(
config: RepositoryCopierConfig,
max_copy_operations: usize,
progress_cb: &Option<Box<dyn Fn(PublishEvent) + Sync>>
) -> Result<()>
Perform a copy operation as defined by a RepositoryCopierConfig.
sourcepub async fn copy_distribution(
&self,
root_reader: &dyn RepositoryRootReader,
writer: &dyn RepositoryWriter,
distribution: &str,
max_copy_operations: usize,
progress_cb: &Option<Box<dyn Fn(PublishEvent) + Sync>>
) -> Result<()>
pub async fn copy_distribution(
&self,
root_reader: &dyn RepositoryRootReader,
writer: &dyn RepositoryWriter,
distribution: &str,
max_copy_operations: usize,
progress_cb: &Option<Box<dyn Fn(PublishEvent) + Sync>>
) -> Result<()>
Copy content for a given distribution given a distribution name.
This is a proxy for Self::copy_distribution_path() which simply passes
dists/{distribution} as the path value. This is the standard layout for Debian
repositories.
sourcepub async fn copy_distribution_path(
&self,
root_reader: &dyn RepositoryRootReader,
writer: &dyn RepositoryWriter,
distribution_path: &str,
max_copy_operations: usize,
progress_cb: &Option<Box<dyn Fn(PublishEvent) + Sync>>
) -> Result<()>
pub async fn copy_distribution_path(
&self,
root_reader: &dyn RepositoryRootReader,
writer: &dyn RepositoryWriter,
distribution_path: &str,
max_copy_operations: usize,
progress_cb: &Option<Box<dyn Fn(PublishEvent) + Sync>>
) -> Result<()>
Copy content for a given distribution at a path relative to the repository root.
The given distribution_path is usually prefixed with dists/. e.g. dists/bullseye.
But it can be something else for non-standard repository layouts.
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for RepositoryCopier
impl Send for RepositoryCopier
impl Sync for RepositoryCopier
impl Unpin for RepositoryCopier
impl UnwindSafe for RepositoryCopier
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
fn vzip(self) -> V
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber to this type, returning a
WithDispatch wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber to this type, returning a
WithDispatch wrapper. Read more