MCPcopy Create free account
hub / github.com/Roy3838/Observer / save

Method save

cli/src/auth.rs:62–78  ·  view source on GitHub ↗

Save tokens to file

(&self)

Source from the content-addressed store, hash-verified

60
61 /// Save tokens to file
62 pub fn save(&self) -> io::Result<()> {
63 let Some(path) = Self::auth_path() else {
64 return Err(io::Error::new(
65 io::ErrorKind::NotFound,
66 "Could not determine config directory",
67 ));
68 };
69
70 if let Some(parent) = path.parent() {
71 fs::create_dir_all(parent)?;
72 }
73
74 let contents = serde_json::to_string_pretty(self)
75 .map_err(|e| io::Error::new(io::ErrorKind::InvalidData, e))?;
76
77 fs::write(path, contents)
78 }
79
80 /// Delete stored tokens
81 pub fn delete() -> io::Result<()> {

Callers 4

get_valid_tokenMethod · 0.45
loginFunction · 0.45
drawStateIconMethod · 0.45
save_temp_imageFunction · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected