pub struct ConsulConfigCenter { /* private fields */ }Expand description
Consul-style in-memory configuration center.
Implementations§
Source§impl ConsulConfigCenter
impl ConsulConfigCenter
pub fn new() -> Self
Sourcepub fn events(&self) -> Vec<ConfigChangeEvent>
pub fn events(&self) -> Vec<ConfigChangeEvent>
Returns the ordered list of all change events that have occurred.
pub fn subscriber_count(&self, key: &str) -> usize
Trait Implementations§
Source§impl ConfigCenter for ConsulConfigCenter
impl ConfigCenter for ConsulConfigCenter
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 ConsulConfigCenter
impl !RefUnwindSafe for ConsulConfigCenter
impl !UnwindSafe for ConsulConfigCenter
impl Send for ConsulConfigCenter
impl Sync for ConsulConfigCenter
impl Unpin for ConsulConfigCenter
impl UnsafeUnpin for ConsulConfigCenter
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