pub struct AcpInstallationState { /* private fields */ }Expand description
Manages the installation state of ACP agents.
Implementations§
Source§impl AcpInstallationState
impl AcpInstallationState
Sourcepub fn new(paths: AcpPaths) -> AcpInstallationState
pub fn new(paths: AcpPaths) -> AcpInstallationState
Create a new installation state manager.
Sourcepub async fn is_installed(&self, agent_id: &str) -> bool
pub async fn is_installed(&self, agent_id: &str) -> bool
Check if an agent is installed.
Sourcepub async fn get_installed_version(&self, agent_id: &str) -> Option<String>
pub async fn get_installed_version(&self, agent_id: &str) -> Option<String>
Get the installed version of an agent.
Sourcepub async fn get_installed_info(
&self,
agent_id: &str,
) -> Option<InstalledAgentInfo>
pub async fn get_installed_info( &self, agent_id: &str, ) -> Option<InstalledAgentInfo>
Get info about an installed agent.
Sourcepub async fn get_all_installed(&self) -> Vec<InstalledAgentInfo>
pub async fn get_all_installed(&self) -> Vec<InstalledAgentInfo>
Get all installed agents.
Sourcepub async fn mark_installed(
&self,
agent_id: &str,
version: &str,
dist_type: DistributionType,
binary_path: Option<String>,
package: Option<String>,
) -> Result<(), String>
pub async fn mark_installed( &self, agent_id: &str, version: &str, dist_type: DistributionType, binary_path: Option<String>, package: Option<String>, ) -> Result<(), String>
Mark an agent as installed.
Sourcepub async fn uninstall(&self, agent_id: &str) -> Result<(), String>
pub async fn uninstall(&self, agent_id: &str) -> Result<(), String>
Uninstall an agent (remove from state).
Sourcepub async fn has_update(&self, agent_id: &str, latest_version: &str) -> bool
pub async fn has_update(&self, agent_id: &str, latest_version: &str) -> bool
Check if an agent has an update available.
Auto Trait Implementations§
impl Freeze for AcpInstallationState
impl !RefUnwindSafe for AcpInstallationState
impl Send for AcpInstallationState
impl Sync for AcpInstallationState
impl Unpin for AcpInstallationState
impl UnsafeUnpin for AcpInstallationState
impl !UnwindSafe for AcpInstallationState
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