Skip to main content

rubbo_core/protocol/
mod.rs

1pub mod kind;
2
3use std::sync::Arc;
4use async_trait::async_trait;
5use crate::error::Result;
6use crate::rpc::Invoker;
7use crate::url::Url;
8
9/// Protocol trait - Entry point for remote communication
10#[async_trait]
11pub trait RpcProtocol: Send + Sync {
12    type Invoker: Invoker;
13    
14    async fn export(&self, invoker: Arc<Box<dyn Invoker>>) -> Result<()>;
15    async fn refer(&self, url: Url) -> Result<Arc<Self::Invoker>>;
16}