add comments

This commit is contained in:
yggverse 2025-01-14 22:28:47 +02:00
parent 2ff6b9d963
commit 941b1cc283

View file

@ -295,12 +295,14 @@ impl Page {
}; };
} }
/// Update `Self` witch children components
pub fn update(&self) { pub fn update(&self) {
// Update components // Update components
self.navigation.update(self.progress_fraction()); self.navigation.update(self.progress_fraction());
// @TODO self.content.update(); // @TODO self.content.update();
} }
/// Cleanup `Self` session
pub fn clean( pub fn clean(
&self, &self,
transaction: &Transaction, transaction: &Transaction,
@ -323,6 +325,7 @@ impl Page {
Ok(()) Ok(())
} }
/// Restore `Self` session from database
pub fn restore( pub fn restore(
&self, &self,
transaction: &Transaction, transaction: &Transaction,
@ -353,6 +356,7 @@ impl Page {
Ok(()) Ok(())
} }
/// Save `Self` session to database
pub fn save( pub fn save(
&self, &self,
transaction: &Transaction, transaction: &Transaction,
@ -382,6 +386,7 @@ impl Page {
self.title.borrow().clone() self.title.borrow().clone()
} }
/// Get value for progress bar, depending on `Self::Status`
pub fn progress_fraction(&self) -> Option<f64> { pub fn progress_fraction(&self) -> Option<f64> {
// Interpret status to progress fraction // Interpret status to progress fraction
match *self.status.borrow() { match *self.status.borrow() {
@ -400,6 +405,7 @@ impl Page {
} }
} }
/// Get `Self` loading status
pub fn is_loading(&self) -> bool { pub fn is_loading(&self) -> bool {
match self.progress_fraction() { match self.progress_fraction() {
Some(progress_fraction) => progress_fraction < 1.0, Some(progress_fraction) => progress_fraction < 1.0,