MCPcopy Index your code
hub / github.com/endbasic/endbasic / enumerate

Method enumerate

client/src/drive.rs:47–62  ·  view source on GitHub ↗
(&self)

Source from the content-addressed store, hash-verified

45 }
46
47 async fn enumerate(&self) -> io::Result<DriveFiles> {
48 let response = self.service.borrow_mut().get_files(&self.username).await?;
49 let mut entries = BTreeMap::default();
50 for e in response.files {
51 let date = match time::OffsetDateTime::from_unix_timestamp(e.mtime as i64) {
52 Ok(date) => date,
53 Err(e) => return Err(io::Error::new(io::ErrorKind::InvalidData, format!("{}", e))),
54 };
55 entries.insert(e.filename, Metadata { date, length: e.length });
56 }
57 Ok(DriveFiles::new(
58 entries,
59 response.disk_quota.map(|x| x.into()),
60 response.disk_free.map(|x| x.into()),
61 ))
62 }
63
64 async fn get(&self, filename: &str) -> io::Result<Vec<u8>> {
65 self.service.borrow_mut().get_file(&self.username, filename).await

Callers 11

argspans_to_exprsFunction · 0.45
disasmMethod · 0.45
describeMethod · 0.45
compile_selectFunction · 0.45
compile_ifFunction · 0.45
declare_callableFunction · 0.45
prepare_globalsFunction · 0.45
compile_argsFunction · 0.45
handle_exceptionMethod · 0.45
execMethod · 0.45

Calls 2

get_filesMethod · 0.45
insertMethod · 0.45

Tested by 2

execMethod · 0.36