Repository

Struct Repository 

Source
pub struct Repository { /* private fields */ }
Expand description

A TUF repository generated by a RepositoryBuilder.

Implementations§

Source§

impl Repository

Source

pub fn iter_blobs( &self, ) -> Result<impl Iterator<Item = Result<Hash, Error>>, Error>

Returns an iterator over all blobs contained in this repository.

Source

pub fn list_blobs(&self) -> Result<BTreeSet<Hash>, Error>

Returns a set of all blobs contained in this repository.

Source

pub fn purge_blobs(&self, blobs: impl Iterator<Item = Hash>)

Removes the specified from the repository.

Source

pub fn read_blob(&self, merkle_root: &Hash) -> Result<Vec<u8>, Error>

Reads the contents of requested blob from the repository.

Source

pub fn read_delivery_blob( &self, delivery_blob_type: u32, merkle_root: &Hash, ) -> Result<Vec<u8>, Error>

Reads the contents of requested delivery blob from the repository.

Source

pub fn write_blob( &self, merkle_root: &Hash, blob: &[u8], ) -> Result<usize, Error>

Writes a blob with the given merkle and data (which may not match), into the repository’s blobs directory, without any compression.

Source

pub fn overwrite_uncompressed_delivery_blob( &self, merkle_root: &Hash, ) -> Result<usize, Error>

Overwrites the delivery blob to uncompressed version from an uncompressed blob that is already in the repository, returns the size of the delivery blob.

Source

pub fn path(&self) -> PathBuf

Returns the path of the base of the repository.

Source

pub fn iter_packages( &self, ) -> Result<impl Iterator<Item = Result<PackageEntry, Error>>, Error>

Returns an iterator over all packages contained in this repository.

Source

pub fn list_packages(&self) -> Result<Vec<PackageEntry>, Error>

Returns a sorted vector of all packages contained in this repository.

Source

pub fn make_repo_config_builder( &self, url: RepositoryUrl, ) -> RepositoryConfigBuilder

Generate a RepositoryConfigBuilder suitable for configuring a package resolver to use this repository when it is served at the given URL.

Source

pub fn make_repo_config( &self, url: RepositoryUrl, mirror_config: Option<MirrorConfig>, use_local_mirror: bool, ) -> RepositoryConfig

Generate a RepositoryConfig suitable for configuring a package resolver to use this repository when it is served at the given URL.

Source

pub fn root_keys(&self) -> BTreeSet<RepositoryKey>

Get the root keys used by this repository.

Source

pub fn server(self: Arc<Self>) -> ServedRepositoryBuilder

Serves the repository over HTTP using hyper.

Trait Implementations§

Source§

impl Debug for Repository

Source§

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

Formats the value using the given formatter. 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, D> Encode<Ambiguous1, D> for T
where D: ResourceDialect,

Source§

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, D> Encode<Ambiguous2, D> for T
where D: ResourceDialect,

Source§

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

§

fn from_service_transport(handle: T) -> T

Converts the given service transport handle of type T to [Self]
§

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.

§

impl<T> IntoAny for T
where T: 'static + Send + Sync,

§

fn into_any(self: Arc<T>) -> Arc<dyn Any + Sync + Send>

Cast the given object into a dyn std::any::Any.
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, U> IntoExt<U> for T
where U: FromExt<T>,

§

fn into_ext(self) -> U

Performs the conversion.
§

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

impl<T, U> TryIntoExt<U> for T
where U: TryFromExt<T>,

§

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

§

fn try_into_ext(self) -> Result<U, <T as TryIntoExt<U>>::Error>

Tries to perform the conversion.
§

impl<T> Unless for T

§

fn unless(self, option: Option<T>) -> T

§

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
§

impl<T> OnRootDirDrop for T
where T: Send + Sync + Debug,

§

impl<E> RunsTransport<Mpsc> for E

§

impl<E> RunsTransport<Mpsc> for E
where E: RunsTransport<Mpsc>,