[][src]Trait potatonet::Topic

pub trait Topic: 'static + Send + Sync + DeserializeOwned + Serialize {
    fn name() -> &'static str;

    fn encode(&self) -> Result<Vec<u8>, Error> { ... }
fn decode(data: &[u8]) -> Result<Self, Error> { ... } }

订阅消息

Required methods

fn name() -> &'static str

Loading content...

Provided methods

fn encode(&self) -> Result<Vec<u8>, Error>

fn decode(data: &[u8]) -> Result<Self, Error>

Loading content...

Implementors

Loading content...