Skip to main content

rubbo_core/
lib.rs

1pub mod error;
2pub mod protocol;
3pub mod url;
4pub mod registry_url;
5pub mod rpc;
6pub mod context;
7
8pub use error::*;
9pub use protocol::kind::ProtocolKind;
10pub use protocol::RpcProtocol;
11pub use url::{Url, RpcUrl};
12pub use registry_url::RegistryUrl;
13pub use rpc::*;
14
15pub trait RubboService {
16    fn to_invoker(self: Box<Self>, url: Url) -> std::sync::Arc<Box<dyn Invoker>>;
17    fn interface_name(&self) -> String;
18    fn methods(&self) -> String;
19    fn group(&self) -> String;
20    fn version(&self) -> String;
21}
22
23pub trait RubboReference {
24    const SERVICE_KEY: &'static str;
25    fn interface_name() -> &'static str;
26    fn group() -> &'static str;
27    fn version() -> &'static str;
28    fn timeout() -> Option<u64>; // Timeout in milliseconds
29    fn create_stub(invoker: std::sync::Arc<Box<dyn Invoker>>) -> std::sync::Arc<Self>;
30}