pub struct Repository {
pub name: String,
pub url: String,
pub trusted: bool,
/* private fields */
}Expand description
Package repository
Fields§
§name: StringRepository name
url: StringRepository URL
trusted: boolIs repository trusted
Implementations§
Source§impl Repository
impl Repository
pub fn new(name: String, url: String, trusted: bool) -> Self
Sourcepub fn fetch_package_list(&self) -> Vec<PackageMetadata>
pub fn fetch_package_list(&self) -> Vec<PackageMetadata>
Fetch package list from repository via HTTP/HTTPS
Sourcepub fn download_package(&self, package_id: &PackageId) -> Option<Vec<u8>>
pub fn download_package(&self, package_id: &PackageId) -> Option<Vec<u8>>
Download package by ID via HTTP/HTTPS
Sourcepub fn has_package(&self, package_id: &PackageId) -> bool
pub fn has_package(&self, package_id: &PackageId) -> bool
Check if package exists in repository
Sourcepub fn get_package(&self, package_id: &PackageId) -> Option<&PackageMetadata>
pub fn get_package(&self, package_id: &PackageId) -> Option<&PackageMetadata>
Get cached package metadata
Sourcepub fn invalidate_cache(&mut self)
pub fn invalidate_cache(&mut self)
Invalidate cache
Sourcepub fn is_cache_stale(&self, current_time: u64) -> bool
pub fn is_cache_stale(&self, current_time: u64) -> bool
Check if cache is stale (older than 1 hour)
Trait Implementations§
Source§impl Clone for Repository
impl Clone for Repository
Source§fn clone(&self) -> Repository
fn clone(&self) -> Repository
Returns a duplicate of the value. Read more
1.0.0§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for Repository
impl Debug for Repository
Auto Trait Implementations§
impl Freeze for Repository
impl RefUnwindSafe for Repository
impl Send for Repository
impl Sync for Repository
impl Unpin for Repository
impl UnwindSafe for Repository
Blanket Implementations§
§impl<T> Any for Twhere
T: 'static + ?Sized,
impl<T> Any for Twhere
T: 'static + ?Sized,
§impl<T> Borrow<T> for Twhere
T: ?Sized,
impl<T> Borrow<T> for Twhere
T: ?Sized,
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
🔬This is a nightly-only experimental API. (
clone_to_uninit)