[][src]Trait potatonet_common::Topic

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

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

订阅消息

Required methods

fn name() -> &'static str

Loading content...

Provided methods

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

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

Loading content...

Implementors

Loading content...