use crate::types::Id;
#[derive(Debug, Clone, PartialEq)]
pub struct ServiceHandle {
pub id: Id,
}
impl ServiceHandle {
pub fn new(id: Id) -> Self {
Self { id }
}
}
pub trait Create {
type Options;
type Error;
fn create(&mut self, options: Self::Options) -> Result<ServiceHandle, Self::Error>;
}
pub trait Register {
type Options;
type Info;
type Error;
fn register(&mut self, options: Self::Options) -> Result<Self::Info, Self::Error>;
}
pub trait Locate {
type Options;
type Info;
type Error;
fn locate(&mut self, options: Self::Options) -> Result<Self::Info, Self::Error>;
}
pub trait Publish {
type Options;
type Info;
type Error;
fn publish(&mut self, options: Self::Options) -> Result<Self::Info, Self::Error>;
}
pub trait Subscribe {
type Options;
type Streamable;
type Error;
fn subscribe(&mut self, options: Self::Options) -> Result<Self::Streamable, Self::Error>;
}