use crate::GenServerOptions;
#[derive(Debug, Default, Clone)]
pub struct RegistryOptions {
pub(crate) name: Option<String>,
}
impl RegistryOptions {
pub const fn new() -> Self {
Self { name: None }
}
pub fn name<T: Into<String>>(mut self, name: T) -> Self {
self.name = Some(name.into());
self
}
}
impl From<RegistryOptions> for GenServerOptions {
fn from(mut value: RegistryOptions) -> Self {
let mut options = GenServerOptions::new();
if let Some(name) = value.name.take() {
options = options.name(name);
}
options
}
}