utils can print remote calendars
This commit is contained in:
parent
45b4c1a056
commit
e622ec0f7e
1 changed files with 19 additions and 0 deletions
19
src/utils.rs
19
src/utils.rs
|
@ -6,6 +6,7 @@ use std::sync::{Arc, Mutex};
|
|||
use minidom::Element;
|
||||
|
||||
use crate::traits::CompleteCalendar;
|
||||
use crate::traits::DavCalendar;
|
||||
use crate::calendar::CalendarId;
|
||||
use crate::Item;
|
||||
use crate::item::SyncStatus;
|
||||
|
@ -77,6 +78,24 @@ where
|
|||
}
|
||||
}
|
||||
|
||||
/// A debug utility that pretty-prints calendars
|
||||
pub async fn print_dav_calendar_list<C>(cals: &HashMap<CalendarId, Arc<Mutex<C>>>)
|
||||
where
|
||||
C: DavCalendar,
|
||||
{
|
||||
for (id, cal) in cals {
|
||||
println!("CAL {}", id);
|
||||
match cal.lock().unwrap().get_item_version_tags().await {
|
||||
Err(_err) => continue,
|
||||
Ok(map) => {
|
||||
for (id, version_tag) in map {
|
||||
println!(" * {} (version {:?})", id, version_tag);
|
||||
}
|
||||
},
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pub fn print_task(item: &Item) {
|
||||
match item {
|
||||
Item::Task(task) => {
|
||||
|
|
Loading…
Add table
Reference in a new issue