pub struct AtticClient { /* private fields */ }Expand description
Attic client for binary cache operations
Implementations§
Source§impl AtticClient
impl AtticClient
Sourcepub fn new(config: AtticConfig) -> AtticClient
pub fn new(config: AtticConfig) -> AtticClient
Create a new Attic client
Sourcepub fn from_env() -> AtticClient
pub fn from_env() -> AtticClient
Create client from environment variables
Sourcepub async fn is_environment_cached(&self, hash: &NixHash) -> bool
pub async fn is_environment_cached(&self, hash: &NixHash) -> bool
Check if an environment is cached
§TDD: test_pull_nonexistent_hash_fails_gracefully
Sourcepub async fn pull_environment(
&self,
hash: &NixHash,
) -> Result<PathBuf, NixError>
pub async fn pull_environment( &self, hash: &NixHash, ) -> Result<PathBuf, NixError>
Pull environment from cache
Returns the path to the cached environment
Sourcepub async fn push_environment(
&self,
hash: &NixHash,
store_path: &Path,
) -> Result<(), NixError>
pub async fn push_environment( &self, hash: &NixHash, store_path: &Path, ) -> Result<(), NixError>
Push environment to cache
Takes the store path of a built environment and pushes it to the cache
Sourcepub async fn build_and_cache(
&self,
flake_path: &Path,
) -> Result<(NixHash, PathBuf), NixError>
pub async fn build_and_cache( &self, flake_path: &Path, ) -> Result<(NixHash, PathBuf), NixError>
Build and cache an environment from a flake
Sourcepub async fn get_cache_info(&self) -> Result<CacheInfo, NixError>
pub async fn get_cache_info(&self) -> Result<CacheInfo, NixError>
Get cache statistics
Auto Trait Implementations§
impl Freeze for AtticClient
impl !RefUnwindSafe for AtticClient
impl Send for AtticClient
impl Sync for AtticClient
impl Unpin for AtticClient
impl UnsafeUnpin for AtticClient
impl !UnwindSafe for AtticClient
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