pub struct NacosClient { /* private fields */ }Expand description
Nacos客户端配置结构体
Implementations§
Source§impl NacosClient
impl NacosClient
Sourcepub async fn init(client_config: NacosConfig) -> Result<NacosClient>
pub async fn init(client_config: NacosConfig) -> Result<NacosClient>
初始化Nacos服务,返回包含服务实例的客户端
Sourcepub async fn register_instance(
&self,
service_name: String,
group_name: Option<String>,
ip: String,
port: i32,
) -> Result<()>
pub async fn register_instance( &self, service_name: String, group_name: Option<String>, ip: String, port: i32, ) -> Result<()>
注册服务实例
Sourcepub async fn subscribe_service(
&self,
group_name: Option<String>,
service_name: String,
) -> Result<()>
pub async fn subscribe_service( &self, group_name: Option<String>, service_name: String, ) -> Result<()>
订阅服务变更通知
Sourcepub fn get_config_service(&self) -> &ConfigService
pub fn get_config_service(&self) -> &ConfigService
获取配置服务引用
Sourcepub fn get_naming_service(&self) -> &NamingService
pub fn get_naming_service(&self) -> &NamingService
获取命名服务引用
Sourcepub fn get_config(&self) -> &NacosConfig
pub fn get_config(&self) -> &NacosConfig
获取客户端配置引用
Trait Implementations§
Source§impl Clone for NacosClient
impl Clone for NacosClient
Source§fn clone(&self) -> NacosClient
fn clone(&self) -> NacosClient
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for NacosClient
impl !RefUnwindSafe for NacosClient
impl Send for NacosClient
impl Sync for NacosClient
impl Unpin for NacosClient
impl !UnwindSafe for NacosClient
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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