pub struct RegistryWriter { /* private fields */ }Expand description
Write handle for the service registry.
Provides register, update, deregister, and health-management operations. All mutations bump the registry version for watcher notification.
Implementations§
Source§impl RegistryWriter
impl RegistryWriter
Sourcepub fn new(region: RegistryRegion) -> Self
pub fn new(region: RegistryRegion) -> Self
Create a writer wrapping the given region.
Sourcepub fn register(&mut self, reg: ServiceRegistration) -> Result<()>
pub fn register(&mut self, reg: ServiceRegistration) -> Result<()>
Register a service instance.
Sourcepub fn deregister(&mut self, name: &str, instance_id: u128) -> Result<bool>
pub fn deregister(&mut self, name: &str, instance_id: u128) -> Result<bool>
Remove a specific instance from the registry.
Sourcepub fn set_health(
&mut self,
name: &str,
instance_id: u128,
health: HealthStatus,
) -> Result<bool>
pub fn set_health( &mut self, name: &str, instance_id: u128, health: HealthStatus, ) -> Result<bool>
Update the health status of a specific instance.
Sourcepub fn set_draining(&mut self, name: &str, instance_id: u128) -> Result<bool>
pub fn set_draining(&mut self, name: &str, instance_id: u128) -> Result<bool>
Set a specific instance to draining.
Sourcepub fn tick(&mut self) -> Result<usize>
pub fn tick(&mut self) -> Result<usize>
Prune expired registrations. Returns the number pruned.
Sourcepub fn lookup(&self, name: &str) -> Result<Vec<ServiceRegistration>>
pub fn lookup(&self, name: &str) -> Result<Vec<ServiceRegistration>>
Look up registrations (convenience — delegates to the underlying region).
Sourcepub fn list_services(&self) -> Result<Vec<String>>
pub fn list_services(&self) -> Result<Vec<String>>
List all service names (convenience).
Auto Trait Implementations§
impl Freeze for RegistryWriter
impl !RefUnwindSafe for RegistryWriter
impl !Send for RegistryWriter
impl !Sync for RegistryWriter
impl Unpin for RegistryWriter
impl !UnwindSafe for RegistryWriter
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