MCPcopy Create free account
hub / github.com/Autoparallel/learner / get_storage_path

Method get_storage_path

crates/learner/src/database/mod.rs:176–189  ·  view source on GitHub ↗

Gets the configured storage path for document files. The storage path determines where document files (like PDFs) will be saved when downloaded through the system. This path is stored in the database configuration and can be modified using [`Database::set_storage_path()`]. # Returns Returns a `Result` containing either: - The configured [`PathBuf`] for document storage - A [`LearnerError`] if t

(&self)

Source from the content-addressed store, hash-verified

174 /// # }
175 /// ```
176 pub async fn get_storage_path(&self) -> Result<PathBuf> {
177 Ok(
178 self
179 .conn
180 .call(|conn| {
181 Ok(
182 conn
183 .prepare_cached("SELECT value FROM config WHERE key = 'storage_path'")?
184 .query_row([], |row| Ok(PathBuf::from(row.get::<_, String>(0)?)))?,
185 )
186 })
187 .await?,
188 )
189 }
190
191 /// Sets the storage path for document files, validating that the path is usable.
192 ///

Callers 12

addFunction · 0.80
openMethod · 0.80
set_storage_pathMethod · 0.80
test_storage_path_validFunction · 0.80
executeMethod · 0.80
test_add_complete_paperFunction · 0.80

Calls

no outgoing calls