pub struct ClientProps { /* private fields */ }Expand description
Configures settings for Client.
Implementations§
Source§impl ClientProps
impl ClientProps
Sourcepub fn server_addr(self, server_addr: impl Into<String>) -> Self
pub fn server_addr(self, server_addr: impl Into<String>) -> Self
Sets the server addr.
Sourcepub fn endpoint(self, endpoint: impl Into<String>) -> Self
pub fn endpoint(self, endpoint: impl Into<String>) -> Self
Sets the endpoint used to resolve server addresses.
Full URL (e.g. http://addr:8080/nacos/serverlist) is used as-is,
only appending namespace if missing from the query string.
Bare hostname (e.g. addr or addr:9090) gets default path
/nacos/serverlist and port 8080.
Sourcepub fn remote_grpc_port(self, grpc_port: u16) -> Self
pub fn remote_grpc_port(self, grpc_port: u16) -> Self
Sets the grpc port
Sourcepub fn naming_push_empty_protection(
self,
naming_push_empty_protection: bool,
) -> Self
pub fn naming_push_empty_protection( self, naming_push_empty_protection: bool, ) -> Self
Sets the naming_push_empty_protection.
Sourcepub fn naming_load_cache_at_start(
self,
naming_load_cache_at_start: bool,
) -> Self
pub fn naming_load_cache_at_start( self, naming_load_cache_at_start: bool, ) -> Self
Sets the naming_load_cache_at_start.
Sourcepub fn config_load_cache_at_start(
self,
config_load_cache_at_start: bool,
) -> Self
pub fn config_load_cache_at_start( self, config_load_cache_at_start: bool, ) -> Self
Sets the config_load_cache_at_start.
Sourcepub fn load_cache_at_start(self, load_cache_at_start: bool) -> Self
pub fn load_cache_at_start(self, load_cache_at_start: bool) -> Self
Sets the config_load_cache_at_start / naming_load_cache_at_start.
Sourcepub fn cache_dir(self, cache_dir: impl Into<PathBuf>) -> Self
pub fn cache_dir(self, cache_dir: impl Into<PathBuf>) -> Self
Sets the root directory used for on-disk caches.
The module and namespace directories are appended to this path.
When env_first is enabled, NACOS_CLIENT_CACHE_DIR takes precedence.
Sourcepub fn auth_username(self, username: impl Into<String>) -> Self
Available on crate feature auth-by-http only.
pub fn auth_username(self, username: impl Into<String>) -> Self
auth-by-http only.Add auth username.
Sourcepub fn auth_password(self, password: impl Into<String>) -> Self
Available on crate feature auth-by-http only.
pub fn auth_password(self, password: impl Into<String>) -> Self
auth-by-http only.Add auth password.
Sourcepub fn auth_ext(self, key: impl Into<String>, val: impl Into<String>) -> Self
pub fn auth_ext(self, key: impl Into<String>, val: impl Into<String>) -> Self
Add auth ext params.
Sourcepub fn max_retries(self, max_retries: u32) -> Self
👎Deprecated
pub fn max_retries(self, max_retries: u32) -> Self
Sets the maximum retry attempts during initialization phase.
This value only applies to the connection initialization stage. If not set, defaults to 1 retry attempts. After successful initialization, the client will retry indefinitely during runtime to ensure fault tolerance.
Trait Implementations§
Source§impl Clone for ClientProps
impl Clone for ClientProps
Source§fn clone(&self) -> ClientProps
fn clone(&self) -> ClientProps
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for ClientProps
impl RefUnwindSafe for ClientProps
impl Send for ClientProps
impl Sync for ClientProps
impl Unpin for ClientProps
impl UnsafeUnpin for ClientProps
impl UnwindSafe for ClientProps
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
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>
T in a tonic::Request