pub struct PapersConfig {
pub embedding_model: String,
}Fields§
§embedding_model: StringImplementations§
Source§impl PapersConfig
impl PapersConfig
Sourcepub fn config_path() -> PathBuf
pub fn config_path() -> PathBuf
Returns <config_dir>/.papers/config.json.
Sourcepub fn load() -> Result<Self, ConfigError>
pub fn load() -> Result<Self, ConfigError>
Loads from disk. Returns Default if file missing. Errors on bad JSON or I/O failure.
Sourcepub fn save(&self) -> Result<(), ConfigError>
pub fn save(&self) -> Result<(), ConfigError>
Writes to disk, creating parent directories as needed.
Sourcepub fn validate_model(name: &str) -> Result<(), ConfigError>
pub fn validate_model(name: &str) -> Result<(), ConfigError>
Returns Err(ConfigError::UnknownModel) if name is not in VALID_MODELS.
Trait Implementations§
Source§impl Debug for PapersConfig
impl Debug for PapersConfig
Source§impl Default for PapersConfig
impl Default for PapersConfig
Source§impl<'de> Deserialize<'de> for PapersConfig
impl<'de> Deserialize<'de> for PapersConfig
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for PapersConfig
impl RefUnwindSafe for PapersConfig
impl Send for PapersConfig
impl Sync for PapersConfig
impl Unpin for PapersConfig
impl UnsafeUnpin for PapersConfig
impl UnwindSafe for PapersConfig
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more