pub struct ConfigManager { /* private fields */ }Implementations§
Source§impl ConfigManager
impl ConfigManager
pub fn new(storage: Arc<dyn Storage>, mode: ConfigMode) -> Self
pub fn support_observer(&self) -> bool
pub async fn observe(&self) -> Result<Observer, Error>
pub fn get_current_config(&self) -> Arc<PingapConfig>
pub fn set_current_config(&self, config: PingapConfig)
pub async fn load_all(&self) -> Result<PingapTomlConfig, Error>
pub async fn save_all(&self, config: &PingapTomlConfig) -> Result<(), Error>
pub async fn update<T: Serialize + Send + Sync>( &self, category: Category, name: &str, value: &T, ) -> Result<(), Error>
pub async fn get<T: DeserializeOwned + Send>( &self, category: Category, name: &str, ) -> Result<Option<T>, Error>
pub async fn delete(&self, category: Category, name: &str) -> Result<(), Error>
pub fn support_history(&self) -> bool
pub async fn history( &self, category: Category, name: &str, ) -> Result<Option<Vec<History>>, Error>
Auto Trait Implementations§
impl !Freeze for ConfigManager
impl !RefUnwindSafe for ConfigManager
impl Send for ConfigManager
impl Sync for ConfigManager
impl Unpin for ConfigManager
impl UnsafeUnpin for ConfigManager
impl !UnwindSafe for ConfigManager
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> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request