pub struct ConfigManager;Expand description
⚙️ ConfigManager - Klasa statyczna do zarządzania plikami.
W Rust “metody statyczne” nie mają &self. Wywołujemy je ConfigManager::metoda().
Implementations§
Source§impl ConfigManager
impl ConfigManager
Sourcepub fn load_global_config() -> GlobalConfig
pub fn load_global_config() -> GlobalConfig
💾 Wczytuje globalną konfigurację. Zwraca GlobalConfig. Jeśli plik nie istnieje, zwraca domyślny (pusty).
Sourcepub fn save_global_config(config: &GlobalConfig)
pub fn save_global_config(config: &GlobalConfig)
💾 Zapisuje globalną konfigurację
Sourcepub fn load_and_clean_data_index(data_folder: &Path) -> DataIndex
pub fn load_and_clean_data_index(data_folder: &Path) -> DataIndex
🧪 Wczytuje indeks baz i CZYŚCI nieistniejące wpisy (Walidacja)
Sourcepub fn save_data_index(data_folder: &Path, index: &DataIndex)
pub fn save_data_index(data_folder: &Path, index: &DataIndex)
💾 Zapisuje indeks baz
Sourcepub async fn create_new_db(
data_folder: &Path,
db_name: &str,
) -> Result<(), Box<dyn Error>>
pub async fn create_new_db( data_folder: &Path, db_name: &str, ) -> Result<(), Box<dyn Error>>
⚙️ Tworzy nową bazę danych FIZYCZNIE (pliki .clog, .manifest)
📚 EDU (Async): async fn zwraca Future (jak Promise w TS).
Musisz użyć .await żeby to wykonać.
Sourcepub fn set_active_db(data_folder: &Path, db_name: &str)
pub fn set_active_db(data_folder: &Path, db_name: &str)
🚦 Ustawia aktywną bazę
Sourcepub fn get_active_db(data_folder: &Path) -> Option<String>
pub fn get_active_db(data_folder: &Path) -> Option<String>
🚦 Pobiera nazwę aktywnej bazy
Auto Trait Implementations§
impl Freeze for ConfigManager
impl RefUnwindSafe for ConfigManager
impl Send for ConfigManager
impl Sync for ConfigManager
impl Unpin 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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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