[][src]Trait potatonet::node::Service

pub trait Service: Send + Sync {
    type Req: Send + Sync + DeserializeOwned + Serialize;
    type Rep: Send + Sync + DeserializeOwned + Serialize;
    type Notify: Send + Sync + DeserializeOwned + Serialize;
    fn start<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        ctx: &'life1 NodeContext<'life2>
    ) -> Pin<Box<dyn Future<Output = ()> + 'async_trait + Send>>
    where
        'life0: 'async_trait,
        'life1: 'async_trait,
        'life2: 'async_trait,
        Self: 'async_trait
, { ... }
fn stop<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        ctx: &'life1 NodeContext<'life2>
    ) -> Pin<Box<dyn Future<Output = ()> + 'async_trait + Send>>
    where
        'life0: 'async_trait,
        'life1: 'async_trait,
        'life2: 'async_trait,
        Self: 'async_trait
, { ... }
fn call<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        ctx: &'life1 NodeContext<'life2>,
        request: Request<Self::Req>
    ) -> Pin<Box<dyn Future<Output = Result<Response<Self::Rep>, Error>> + 'async_trait + Send>>
    where
        'life0: 'async_trait,
        'life1: 'async_trait,
        'life2: 'async_trait,
        Self: 'async_trait
, { ... }
fn notify<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        ctx: &'life1 NodeContext<'life2>,
        request: Request<Self::Notify>
    ) -> Pin<Box<dyn Future<Output = ()> + 'async_trait + Send>>
    where
        'life0: 'async_trait,
        'life1: 'async_trait,
        'life2: 'async_trait,
        Self: 'async_trait
, { ... }
fn event<'life0, 'life1, 'life2, 'life3, 'async_trait>(
        &'life0 self,
        ctx: &'life1 NodeContext<'life2>,
        event: &'life3 Event
    ) -> Pin<Box<dyn Future<Output = ()> + 'async_trait + Send>>
    where
        'life0: 'async_trait,
        'life1: 'async_trait,
        'life2: 'async_trait,
        'life3: 'async_trait,
        Self: 'async_trait
, { ... } }

服务

Associated Types

type Req: Send + Sync + DeserializeOwned + Serialize

请求类型

type Rep: Send + Sync + DeserializeOwned + Serialize

响应类型

type Notify: Send + Sync + DeserializeOwned + Serialize

通知类型

Loading content...

Provided methods

fn start<'life0, 'life1, 'life2, 'async_trait>(
    &'life0 self,
    ctx: &'life1 NodeContext<'life2>
) -> Pin<Box<dyn Future<Output = ()> + 'async_trait + Send>> where
    'life0: 'async_trait,
    'life1: 'async_trait,
    'life2: 'async_trait,
    Self: 'async_trait, 

开始服务

fn stop<'life0, 'life1, 'life2, 'async_trait>(
    &'life0 self,
    ctx: &'life1 NodeContext<'life2>
) -> Pin<Box<dyn Future<Output = ()> + 'async_trait + Send>> where
    'life0: 'async_trait,
    'life1: 'async_trait,
    'life2: 'async_trait,
    Self: 'async_trait, 

停止服务

fn call<'life0, 'life1, 'life2, 'async_trait>(
    &'life0 self,
    ctx: &'life1 NodeContext<'life2>,
    request: Request<Self::Req>
) -> Pin<Box<dyn Future<Output = Result<Response<Self::Rep>, Error>> + 'async_trait + Send>> where
    'life0: 'async_trait,
    'life1: 'async_trait,
    'life2: 'async_trait,
    Self: 'async_trait, 

功能调用

fn notify<'life0, 'life1, 'life2, 'async_trait>(
    &'life0 self,
    ctx: &'life1 NodeContext<'life2>,
    request: Request<Self::Notify>
) -> Pin<Box<dyn Future<Output = ()> + 'async_trait + Send>> where
    'life0: 'async_trait,
    'life1: 'async_trait,
    'life2: 'async_trait,
    Self: 'async_trait, 

通知

fn event<'life0, 'life1, 'life2, 'life3, 'async_trait>(
    &'life0 self,
    ctx: &'life1 NodeContext<'life2>,
    event: &'life3 Event
) -> Pin<Box<dyn Future<Output = ()> + 'async_trait + Send>> where
    'life0: 'async_trait,
    'life1: 'async_trait,
    'life2: 'async_trait,
    'life3: 'async_trait,
    Self: 'async_trait, 

系统事件

Loading content...

Implementors

impl Service for Logger[src]

type Req = __RequestType_Logger

type Rep = __ResponseTypeLogger

type Notify = __NotifyTypeLogger

Loading content...