pub struct NacosConfigCenter { /* private fields */ }Expand description
Nacos-style in-memory configuration center.
Implementations§
Source§impl NacosConfigCenter
impl NacosConfigCenter
pub fn new() -> Self
pub fn events(&self) -> Vec<ConfigChangeEvent>
pub fn subscriber_count(&self, key: &str) -> usize
Trait Implementations§
Source§impl ConfigCenter for NacosConfigCenter
impl ConfigCenter for NacosConfigCenter
fn get(&self, key: &str) -> Option<String>
fn set(&mut self, key: &str, value: &str)
fn delete(&mut self, key: &str) -> bool
fn exists(&self, key: &str) -> bool
fn list(&self) -> Vec<String>
Source§fn watch(&self, _key: &str) -> bool
fn watch(&self, _key: &str) -> bool
Returns true if a watch was successfully registered.
In this in-memory implementation, registration always succeeds.
Source§fn subscribe(&mut self, key: &str, callback: ConfigChangeCallback)
fn subscribe(&mut self, key: &str, callback: ConfigChangeCallback)
Registers a callback for changes to
key.Auto Trait Implementations§
impl !Freeze for NacosConfigCenter
impl !RefUnwindSafe for NacosConfigCenter
impl !UnwindSafe for NacosConfigCenter
impl Send for NacosConfigCenter
impl Sync for NacosConfigCenter
impl Unpin for NacosConfigCenter
impl UnsafeUnpin for NacosConfigCenter
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