pub struct BuildCache { /* private fields */ }Expand description
Content-addressed build cache backed by Arrow.
Stores compiled artifacts keyed by the SHA-256 hash of the source body. Same body → same hash → same compiled output → cache hit.
Implementations§
Source§impl BuildCache
impl BuildCache
Sourcepub fn get(&mut self, body_hash: &str) -> Option<&CacheEntry>
pub fn get(&mut self, body_hash: &str) -> Option<&CacheEntry>
Look up a cached artifact by body hash.
Sourcepub fn put(&mut self, entry: CacheEntry)
pub fn put(&mut self, entry: CacheEntry)
Store a compiled artifact in the cache.
Sourcepub fn stats(&self) -> &CacheStats
pub fn stats(&self) -> &CacheStats
Current cache statistics.
Sourcepub fn remove(&mut self, body_hash: &str) -> bool
pub fn remove(&mut self, body_hash: &str) -> bool
Remove a cached artifact by body hash. Returns true if found.
Sourcepub fn reset_stats(&mut self)
pub fn reset_stats(&mut self)
Reset statistics counters (keeps cached entries).
Sourcepub fn to_record_batch(&self) -> Result<RecordBatch, ArrowError>
pub fn to_record_batch(&self) -> Result<RecordBatch, ArrowError>
Serialize cache to an Arrow RecordBatch.
Sourcepub fn from_record_batch(batch: &RecordBatch) -> Result<Self, String>
pub fn from_record_batch(batch: &RecordBatch) -> Result<Self, String>
Deserialize cache from an Arrow RecordBatch.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for BuildCache
impl RefUnwindSafe for BuildCache
impl Send for BuildCache
impl Sync for BuildCache
impl Unpin for BuildCache
impl UnsafeUnpin for BuildCache
impl UnwindSafe for BuildCache
Blanket Implementations§
impl<T> Allocation for T
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