All checks were successful
continuous-integration/drone/push Build is passing
Signed-off-by: kjuulh <contact@kjuulh.io>
33 lines
559 B
Rust
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 {})
|
|
}
|
|
}
|