pub struct GitIndex {
pub url: String,
pub local_path: PathBuf,
}Fields§
§url: String§local_path: PathBufImplementations§
Source§impl GitIndex
impl GitIndex
pub fn new(url: impl Into<String>, local_path: impl Into<PathBuf>) -> Self
Sourcepub fn refresh_if_stale(&self, ttl: Duration) -> Result<bool>
pub fn refresh_if_stale(&self, ttl: Duration) -> Result<bool>
Refresh only if the local clone is older than ttl.
Returns true when an actual network fetch was performed.
Sourcepub fn is_available(&self) -> bool
pub fn is_available(&self) -> bool
True when the local clone exists and has been fetched at least once.
Sourcepub fn local_path(&self) -> &Path
pub fn local_path(&self) -> &Path
Path to the local clone of this registry.
Trait Implementations§
Source§impl IndexBackend for GitIndex
impl IndexBackend for GitIndex
fn name(&self) -> &str
Source§fn get_manifest(&self, tool: &str, version: &VersionReq) -> Result<Manifest>
fn get_manifest(&self, tool: &str, version: &VersionReq) -> Result<Manifest>
Resolve the best manifest matching
version for tool.Source§fn list_versions(&self, tool: &str) -> Result<Vec<Version>>
fn list_versions(&self, tool: &str) -> Result<Vec<Version>>
List all available versions of
tool.Source§fn list_tools(&self) -> Result<Vec<ToolSummary>>
fn list_tools(&self) -> Result<Vec<ToolSummary>>
List all tools in this index.
Source§fn get_data_manifest(
&self,
dataset: &str,
version: Option<&str>,
) -> Result<DataManifest>
fn get_data_manifest( &self, dataset: &str, version: Option<&str>, ) -> Result<DataManifest>
Resolve the data manifest for
dataset. version is the exact version string
(e.g. "2024_01"); pass None to get the lexicographically latest version.Auto Trait Implementations§
impl Freeze for GitIndex
impl RefUnwindSafe for GitIndex
impl Send for GitIndex
impl Sync for GitIndex
impl Unpin for GitIndex
impl UnsafeUnpin for GitIndex
impl UnwindSafe for GitIndex
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