churn-v2/crates/churn/src/agent/agent_state.rs
kjuulh d1e9eb9eb5
All checks were successful
continuous-integration/drone/push Build is passing
feat: add agent
Signed-off-by: kjuulh <contact@kjuulh.io>
2024-11-24 00:53:43 +01:00

33 lines
559 B
Rust

use std::{ops::Deref, sync::Arc};
#[derive(Clone)]
pub struct AgentState(Arc<State>);
impl AgentState {
pub async fn new() -> anyhow::Result<Self> {
Ok(Self(Arc::new(State::new().await?)))
}
}
impl From<&AgentState> for AgentState {
fn from(value: &AgentState) -> Self {
value.clone()
}
}
impl Deref for AgentState {
type Target = Arc<State>;
fn deref(&self) -> &Self::Target {
&self.0
}
}
pub struct State {}
impl State {
pub async fn new() -> anyhow::Result<Self> {
Ok(Self {})
}
}