pub struct CacheAgent { /* private fields */ }Expand description
Shared state for an agent hosted by the top-level mise run process.
Transport listeners deliberately live in mise so the task-run lifecycle owns them. This type only contains ecosystem-independent CAS and protocol logic.
Implementations§
Source§impl CacheAgent
impl CacheAgent
Sourcepub fn new(cache_dir: impl Into<PathBuf>, version: impl Into<Arc<str>>) -> Self
pub fn new(cache_dir: impl Into<PathBuf>, version: impl Into<Arc<str>>) -> Self
Create an agent backed by the cache rooted at cache_dir.
Sourcepub fn new_remote(
cache_dir: impl Into<PathBuf>,
version: impl Into<Arc<str>>,
remote: AgentRemoteCache,
) -> Self
pub fn new_remote( cache_dir: impl Into<PathBuf>, version: impl Into<Arc<str>>, remote: AgentRemoteCache, ) -> Self
Create an agent with local-first access to a remote action cache.
Sourcepub async fn begin_task(&self, task: &str) -> Result<String>
pub async fn begin_task(&self, task: &str) -> Result<String>
Load the last successful action manifest for a task into this session.
Sourcepub async fn cancel_prefetches(&self)
pub async fn cancel_prefetches(&self)
Cancel speculative downloads before the owning session exits.
Sourcepub async fn commit_task(&self, run: &str) -> Result<()>
pub async fn commit_task(&self, run: &str) -> Result<()>
Atomically publish the candidate manifest collected by a successful task.
Sourcepub fn stats(&self) -> AgentStats
pub fn stats(&self) -> AgentStats
Return a snapshot of this session’s cache activity.
Sourcepub async fn handle_connection<S>(&self, stream: S) -> Result<()>
pub async fn handle_connection<S>(&self, stream: S) -> Result<()>
Serve newline-delimited protocol requests on an authenticated session stream.
Trait Implementations§
Source§impl Clone for CacheAgent
impl Clone for CacheAgent
Source§fn clone(&self) -> CacheAgent
fn clone(&self) -> CacheAgent
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl !RefUnwindSafe for CacheAgent
impl !UnwindSafe for CacheAgent
impl Freeze for CacheAgent
impl Send for CacheAgent
impl Sync for CacheAgent
impl Unpin for CacheAgent
impl UnsafeUnpin for CacheAgent
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