pub struct App<R>where
R: Registry,{
pub config: AppConfig,
/* private fields */
}Expand description
RPC 应用程序
Fields§
§config: AppConfig应用配置
Implementations§
Source§impl<R> App<R>where
R: Registry,
impl<R> App<R>where
R: Registry,
Sourcepub fn new_simple(name: &str) -> Self
pub fn new_simple(name: &str) -> Self
创建简单应用实例(使用随机ID)
Sourcepub fn new_not_register(id: &str, name: &str, version: &str) -> Self
pub fn new_not_register(id: &str, name: &str, version: &str) -> Self
创建不需要注册的应用实例
Sourcepub fn new_simple_not_register(name: &str) -> Self
pub fn new_simple_not_register(name: &str) -> Self
创建简单的不需要注册的应用实例
Sourcepub fn set_weight(&mut self, weight: u32) -> &mut Self
pub fn set_weight(&mut self, weight: u32) -> &mut Self
设置服务权重
Auto Trait Implementations§
impl<R> Freeze for App<R>where
R: Freeze,
impl<R> RefUnwindSafe for App<R>where
R: RefUnwindSafe,
impl<R> Send for App<R>
impl<R> Sync for App<R>
impl<R> Unpin for App<R>where
R: Unpin,
impl<R> UnwindSafe for App<R>where
R: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request