RepositoryCopier

Struct 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§

Source§

impl RepositoryCopier

Source

pub fn set_only_components(&mut self, components: impl Iterator<Item = String>)

Set an explicit list of components whose files to copy.

Source

pub fn set_binary_packages_copy(&mut self, value: bool)

Set whether to copy non-installer binary packages.

Source

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.

Source

pub fn set_installer_binary_packages_copy(&mut self, value: bool)

Set whether to copy installer binary packages.

Source

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.

Source

pub fn set_sources_copy(&mut self, value: bool)

Set whether to copy sources package files.

Source

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.

Source

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.

Source

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§

Source§

impl Default for RepositoryCopier

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

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
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more