pub struct SideEffectsCache { /* private fields */ }Expand description
Cache for package build outputs (side effects of install scripts). After a package runs its install scripts (preinstall, install, postinstall), the resulting output is cached keyed by (package, version, platform, arch).
Implementations§
Source§impl SideEffectsCache
impl SideEffectsCache
Sourcepub fn new(base_dir: Option<PathBuf>) -> Self
pub fn new(base_dir: Option<PathBuf>) -> Self
Create a new SideEffectsCache, storing cached outputs under the given directory.
Sourcepub fn has(&self, package_name: &str, version: &str) -> bool
pub fn has(&self, package_name: &str, version: &str) -> bool
Check if side effects are cached for a given package.
Sourcepub fn store(
&self,
package_name: &str,
version: &str,
package_dir: &Path,
) -> Result<()>
pub fn store( &self, package_name: &str, version: &str, package_dir: &Path, ) -> Result<()>
Store the side effects (built output) for a package.
package_dir is the directory of the installed package after scripts ran.
Auto Trait Implementations§
impl Freeze for SideEffectsCache
impl RefUnwindSafe for SideEffectsCache
impl Send for SideEffectsCache
impl Sync for SideEffectsCache
impl Unpin for SideEffectsCache
impl UnsafeUnpin for SideEffectsCache
impl UnwindSafe for SideEffectsCache
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