pub struct RegistryStorage { /* private fields */ }Expand description
Storage layer for backend registry
Implementations§
Source§impl RegistryStorage
impl RegistryStorage
Sourcepub async fn new(config: RegistryStorageConfig) -> Result<Self, String>
pub async fn new(config: RegistryStorageConfig) -> Result<Self, String>
Create a new registry storage instance
Sourcepub async fn register(
&self,
name: String,
host: String,
port: u16,
protocol: String,
description: Option<String>,
namespace: Option<String>,
source: BackendSource,
) -> Result<BackendInfo, String>
pub async fn register( &self, name: String, host: String, port: u16, protocol: String, description: Option<String>, namespace: Option<String>, source: BackendSource, ) -> Result<BackendInfo, String>
Register a new backend
Sourcepub async fn list(&self, active_only: bool) -> Result<Vec<BackendInfo>, String>
pub async fn list(&self, active_only: bool) -> Result<Vec<BackendInfo>, String>
List all backends (optionally filter by active status)
Sourcepub async fn get(&self, name: &str) -> Result<Option<BackendInfo>, String>
pub async fn get(&self, name: &str) -> Result<Option<BackendInfo>, String>
Get a backend by name
Sourcepub async fn update(
&self,
name: &str,
host: Option<String>,
port: Option<u16>,
protocol: Option<String>,
description: Option<String>,
namespace: Option<String>,
) -> Result<Option<BackendInfo>, String>
pub async fn update( &self, name: &str, host: Option<String>, port: Option<u16>, protocol: Option<String>, description: Option<String>, namespace: Option<String>, ) -> Result<Option<BackendInfo>, String>
Update a backend
Sourcepub async fn ping(&self, name: &str) -> Result<bool, String>
pub async fn ping(&self, name: &str) -> Result<bool, String>
Update last_seen timestamp for health checks
Sourcepub async fn load_config(&self) -> Result<Vec<BackendInfo>, String>
pub async fn load_config(&self) -> Result<Vec<BackendInfo>, String>
Load backends from TOML config file
Sourcepub async fn reload_config(&self) -> Result<usize, String>
pub async fn reload_config(&self) -> Result<usize, String>
Reload config file (re-load and register any new backends)
Auto Trait Implementations§
impl Freeze for RegistryStorage
impl !RefUnwindSafe for RegistryStorage
impl Send for RegistryStorage
impl Sync for RegistryStorage
impl Unpin for RegistryStorage
impl UnsafeUnpin for RegistryStorage
impl !UnwindSafe for RegistryStorage
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> 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> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more