pub struct InMemoryProjectReferenceCache {
pub save_path: String,
pub cache: HashSet<String>,
pub local_source_service: LocalSourceService,
pub local_repo_service: LocalRepoService,
pub clone_path: String,
}Fields§
§save_path: String§cache: HashSet<String>§local_source_service: LocalSourceService§local_repo_service: LocalRepoService§clone_path: StringImplementations§
Source§impl InMemoryProjectReferenceCache
impl InMemoryProjectReferenceCache
Sourcepub fn new(save_path: String) -> Self
pub fn new(save_path: String) -> Self
Create a new InMemoryProjectReferenceCache instance. The save_path is the path to the file where the cache will be saved.
Sourcepub fn load_or_create(path: &str) -> Result<Self, SkootError>
pub fn load_or_create(path: &str) -> Result<Self, SkootError>
Load the cache from the file at save_path or create a new cache if the file does not exist.
§Errors
Returns an error if the cache can’t be loaded or created.
Sourcepub fn load(&mut self) -> Result<(), SkootError>
pub fn load(&mut self) -> Result<(), SkootError>
Trait Implementations§
Source§impl ProjectReferenceCache for InMemoryProjectReferenceCache
impl ProjectReferenceCache for InMemoryProjectReferenceCache
async fn list(&self) -> Result<HashSet<String>, SkootError>
async fn get( &mut self, repo_url: String, ) -> Result<InitializedProject, SkootError>
async fn set(&mut self, repo_url: String) -> Result<(), SkootError>
async fn delete(&mut self, repo_url: String) -> Result<(), SkootError>
Auto Trait Implementations§
impl Freeze for InMemoryProjectReferenceCache
impl RefUnwindSafe for InMemoryProjectReferenceCache
impl Send for InMemoryProjectReferenceCache
impl Sync for InMemoryProjectReferenceCache
impl Unpin for InMemoryProjectReferenceCache
impl UnwindSafe for InMemoryProjectReferenceCache
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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