use crate::{MessageReplyInterface, MessageRequest, StdResult};
use rseip_core::{
codec::{Decode, Encode},
Error,
};
#[async_trait::async_trait(?Send)]
pub trait MessageService {
type Error: Error;
async fn send<'de, P, D, R>(&mut self, mr: MessageRequest<P, D>) -> StdResult<R, Self::Error>
where
P: Encode,
D: Encode,
R: MessageReplyInterface + Decode<'de> + 'static;
async fn close(&mut self) -> StdResult<(), Self::Error>;
fn closed(&self) -> bool;
}