use std::sync::Arc;
use tokio::sync::Mutex;
use crate::error::{AgentClientError, AgentClientResult};
use crate::message::IntoOutboundMessage;
use crate::transport::AgentTransport;
pub struct AgentStream<T>
where
T: AgentTransport,
{
id: u32,
transport: Arc<Mutex<T>>,
}
impl<T> AgentStream<T>
where
T: AgentTransport,
{
#[allow(dead_code)]
pub(crate) fn new(id: u32, transport: Arc<Mutex<T>>) -> Self {
Self { id, transport }
}
pub fn id(&self) -> u32 {
self.id
}
pub async fn send<M>(&self, message: M) -> AgentClientResult<()>
where
M: IntoOutboundMessage,
{
let _ = message;
let _transport = self.transport.lock().await;
Err(AgentClientError::NotImplemented("stream send"))
}
}