Skip to main content

RepoBuilder

Struct RepoBuilder 

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

Source

pub fn create(repo: R, repo_keys: &'a RepoKeys) -> RepoBuilder<'a, R>

Source

pub fn from_database( repo: R, repo_keys: &'a RepoKeys, database: &'a Database<Pouf1>, ) -> RepoBuilder<'a, R>

Source

pub fn signing_repo_keys(self, signing_repo_keys: &'a RepoKeys) -> Self

Source

pub fn current_time(self, current_time: DateTime<Utc>) -> Self

Source

pub fn time_versioning(self, time_versioning: bool) -> Self

Source

pub fn refresh_metadata(self, refresh_metadata: bool) -> Self

Always generate new root, targets, snapshot, and timestamp metadata, even if unchanged and not expired.

Source

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.

Source

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.

Source

pub fn ignore_missing_packages(self, ignore_missing_packages: bool) -> Self

Whether or not to raise an error if package does not exist.

Source

pub async fn add_package(self, path: Utf8PathBuf) -> Result<RepoBuilder<'a, R>>

Stage a package manifest from the path to be published.

Source

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.

Source

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.

Source

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.

Source

pub async fn add_package_archive( self, path: Utf8PathBuf, ) -> Result<RepoBuilder<'a, R>>

Stage a package archive from the path to be published.

Source

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.

Source

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.

Source

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.

Source

pub async fn commit(self) -> Result<(HashSet<Utf8PathBuf>, BTreeSet<BlobInfo>)>

Read all remaining subpackages, and then commit the changes to the repository.

Returns the list of the files that were read and the staged blobs.

Trait Implementations§

Source§

impl<'a, R: Debug + RepoStorageProvider> Debug for RepoBuilder<'a, R>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

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

impl<T, D> Encode<Ambiguous1, D> for T
where D: ResourceDialect,

§

unsafe fn encode( self, _encoder: &mut Encoder<'_, D>, _offset: usize, _depth: Depth, ) -> Result<(), Error>

Encodes the object into the encoder’s buffers. Any handles stored in the object are swapped for Handle::INVALID. Read more
§

impl<T, D> Encode<Ambiguous2, D> for T
where D: ResourceDialect,

§

unsafe fn encode( self, _encoder: &mut Encoder<'_, D>, _offset: usize, _depth: Depth, ) -> Result<(), Error>

Encodes the object into the encoder’s buffers. Any handles stored in the object are swapped for Handle::INVALID. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

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

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

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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

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

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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<T> Pointable for T

§

const ALIGN: usize

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
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.
§

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

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

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
§

fn with_current_subscriber(self) -> WithDispatch<Self>

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