pub struct WorkdirCache {
pub workdir: PathBuf,
pub scanned_at: DateTime<Utc>,
pub repos: Vec<DiscoveredRepo>,
}Fields§
§workdir: PathBuf§scanned_at: DateTime<Utc>§repos: Vec<DiscoveredRepo>Implementations§
Source§impl WorkdirCache
impl WorkdirCache
pub fn load(path: &Path) -> Result<Option<Self>>
Sourcepub fn save(&self, path: &Path) -> Result<()>
pub fn save(&self, path: &Path) -> Result<()>
Atomic write: temp file in the same directory, then rename over the target.
Sourcepub fn lookup(&self, normalized_urls: &[String]) -> Option<&DiscoveredRepo>
pub fn lookup(&self, normalized_urls: &[String]) -> Option<&DiscoveredRepo>
The first cached repo (still present on disk) with a remote matching one of
normalized_urls.
Trait Implementations§
Source§impl Clone for WorkdirCache
impl Clone for WorkdirCache
Source§impl Debug for WorkdirCache
impl Debug for WorkdirCache
Source§impl<'de> Deserialize<'de> for WorkdirCache
impl<'de> Deserialize<'de> for WorkdirCache
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for WorkdirCache
impl RefUnwindSafe for WorkdirCache
impl Send for WorkdirCache
impl Sync for WorkdirCache
impl Unpin for WorkdirCache
impl UnsafeUnpin for WorkdirCache
impl UnwindSafe for WorkdirCache
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
Mutably borrows from an owned value. Read more