pub struct NamingService { /* private fields */ }Available on crate feature
naming only.Expand description
Api NamingService.
§Examples
let naming_service = nacos_sdk::api::naming::NamingServiceBuilder::new(
nacos_sdk::api::props::ClientProps::new()
.server_addr("127.0.0.1:8848")
// Attention! "public" is "", it is recommended to customize the namespace with clear meaning.
.namespace("")
.app_name("todo-your-app-name"),
)
.build()
.await?;Implementations§
Source§impl NamingService
impl NamingService
pub async fn register_instance( &self, service_name: String, group_name: Option<String>, service_instance: ServiceInstance, ) -> Result<()>
pub async fn deregister_instance( &self, service_name: String, group_name: Option<String>, service_instance: ServiceInstance, ) -> Result<()>
pub async fn batch_register_instance( &self, service_name: String, group_name: Option<String>, service_instances: Vec<ServiceInstance>, ) -> Result<()>
pub async fn get_all_instances( &self, service_name: String, group_name: Option<String>, clusters: Vec<String>, subscribe: bool, ) -> Result<Vec<ServiceInstance>>
pub async fn select_instances( &self, service_name: String, group_name: Option<String>, clusters: Vec<String>, subscribe: bool, healthy: bool, ) -> Result<Vec<ServiceInstance>>
pub async fn select_one_healthy_instance( &self, service_name: String, group_name: Option<String>, clusters: Vec<String>, subscribe: bool, ) -> Result<ServiceInstance>
pub async fn get_service_list( &self, page_no: i32, page_size: i32, group_name: Option<String>, ) -> Result<(Vec<String>, i32)>
pub async fn subscribe( &self, service_name: String, group_name: Option<String>, clusters: Vec<String>, event_listener: Arc<dyn NamingEventListener>, ) -> Result<()>
pub async fn unsubscribe( &self, service_name: String, group_name: Option<String>, clusters: Vec<String>, event_listener: Arc<dyn NamingEventListener>, ) -> Result<()>
Trait Implementations§
Source§impl Clone for NamingService
impl Clone for NamingService
Source§fn clone(&self) -> NamingService
fn clone(&self) -> NamingService
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 !RefUnwindSafe for NamingService
impl !UnwindSafe for NamingService
impl Freeze for NamingService
impl Send for NamingService
impl Sync for NamingService
impl Unpin for NamingService
impl UnsafeUnpin for NamingService
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