pub struct RepoBuilder<'a, R: RepoStorageProvider> { /* private fields */ }Expand description
RepoBuilder can create and manipulate package repositories.
Implementations§
Source§impl<'a, R> RepoBuilder<'a, R>where
R: RepoStorageProvider,
impl<'a, R> RepoBuilder<'a, R>where
R: RepoStorageProvider,
pub fn create(repo: R, repo_keys: &'a RepoKeys) -> RepoBuilder<'a, R>
pub fn from_database( repo: R, repo_keys: &'a RepoKeys, database: &'a Database<Pouf1>, ) -> RepoBuilder<'a, R>
pub fn signing_repo_keys(self, signing_repo_keys: &'a RepoKeys) -> Self
pub fn current_time(self, current_time: DateTime<Utc>) -> Self
pub fn time_versioning(self, time_versioning: bool) -> Self
Sourcepub fn refresh_metadata(self, refresh_metadata: bool) -> Self
pub fn refresh_metadata(self, refresh_metadata: bool) -> Self
Always generate new root, targets, snapshot, and timestamp metadata, even if unchanged and not expired.
Sourcepub fn refresh_non_root_metadata(self, refresh_non_root_metadata: bool) -> Self
pub fn refresh_non_root_metadata(self, refresh_non_root_metadata: bool) -> Self
Generate a new targets, snapshot, and timestamp metadata, even if unchanged and not expired.
Sourcepub fn inherit_from_trusted_targets(
self,
inherit_from_trusted_targets: bool,
) -> Self
pub fn inherit_from_trusted_targets( self, inherit_from_trusted_targets: bool, ) -> Self
Whether or not the new targets metadata inherits targets and delegations from the trusted targets metadata.
Default is true.
Sourcepub fn ignore_missing_packages(self, ignore_missing_packages: bool) -> Self
pub fn ignore_missing_packages(self, ignore_missing_packages: bool) -> Self
Whether or not to raise an error if package does not exist.
Sourcepub async fn add_package(self, path: Utf8PathBuf) -> Result<RepoBuilder<'a, R>>
pub async fn add_package(self, path: Utf8PathBuf) -> Result<RepoBuilder<'a, R>>
Stage a package manifest from the path to be published.
Sourcepub async fn add_packages(
self,
paths: impl Iterator<Item = Utf8PathBuf>,
) -> Result<RepoBuilder<'a, R>>
pub async fn add_packages( self, paths: impl Iterator<Item = Utf8PathBuf>, ) -> Result<RepoBuilder<'a, R>>
Stage the package manifests from the iterator of paths to be published.
Sourcepub async fn add_package_manifest(
self,
path: Option<Utf8PathBuf>,
manifest: PackageManifest,
) -> Result<RepoBuilder<'a, R>>
pub async fn add_package_manifest( self, path: Option<Utf8PathBuf>, manifest: PackageManifest, ) -> Result<RepoBuilder<'a, R>>
Stage a package manifest, which was optionally loaded from path, to be published.
Sourcepub async fn add_package_manifests(
self,
iter: impl Iterator<Item = (Option<Utf8PathBuf>, PackageManifest)>,
) -> Result<RepoBuilder<'a, R>>
pub async fn add_package_manifests( self, iter: impl Iterator<Item = (Option<Utf8PathBuf>, PackageManifest)>, ) -> Result<RepoBuilder<'a, R>>
Stage all the top-level package manifests from iter to be published.
Sourcepub async fn add_package_archive(
self,
path: Utf8PathBuf,
) -> Result<RepoBuilder<'a, R>>
pub async fn add_package_archive( self, path: Utf8PathBuf, ) -> Result<RepoBuilder<'a, R>>
Stage a package archive from the path to be published.
Sourcepub async fn add_package_archives(
self,
paths: impl Iterator<Item = Utf8PathBuf>,
) -> Result<RepoBuilder<'a, R>>
pub async fn add_package_archives( self, paths: impl Iterator<Item = Utf8PathBuf>, ) -> Result<RepoBuilder<'a, R>>
Stage the package archives from the iterator of paths to be published.
Sourcepub async fn add_package_list(
self,
path: Utf8PathBuf,
) -> Result<RepoBuilder<'a, R>>
pub async fn add_package_list( self, path: Utf8PathBuf, ) -> Result<RepoBuilder<'a, R>>
Stage all the packages pointed to by the package list to be published. Paths in the package list file are relative to the directory that contains the package list.
Sourcepub async fn add_package_lists(
self,
paths: impl Iterator<Item = Utf8PathBuf>,
) -> Result<RepoBuilder<'a, R>>
pub async fn add_package_lists( self, paths: impl Iterator<Item = Utf8PathBuf>, ) -> Result<RepoBuilder<'a, R>>
Stage all the packages pointed to by the iterator of package lists to be published.
Trait Implementations§
Auto Trait Implementations§
impl<'a, R> Freeze for RepoBuilder<'a, R>where
R: Freeze,
impl<'a, R> !RefUnwindSafe for RepoBuilder<'a, R>
impl<'a, R> !Send for RepoBuilder<'a, R>
impl<'a, R> !Sync for RepoBuilder<'a, R>
impl<'a, R> Unpin for RepoBuilder<'a, R>where
R: Unpin,
impl<'a, R> UnsafeUnpin for RepoBuilder<'a, R>where
R: UnsafeUnpin,
impl<'a, R> !UnwindSafe for RepoBuilder<'a, R>
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, D> Encode<Ambiguous1, D> for Twhere
D: ResourceDialect,
impl<T, D> Encode<Ambiguous1, D> for Twhere
D: ResourceDialect,
§impl<T, D> Encode<Ambiguous2, D> for Twhere
D: ResourceDialect,
impl<T, D> Encode<Ambiguous2, D> for Twhere
D: ResourceDialect,
§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