Struct spyglass_lens::LensConfig
source · pub struct LensConfig {Show 16 fields
pub author: String,
pub name: String,
pub label: String,
pub description: Option<String>,
pub domains: Vec<String>,
pub urls: Vec<String>,
pub version: String,
pub rules: Vec<LensRule>,
pub trigger: String,
pub pipeline: Option<String>,
pub lens_source: LensSource,
pub categories: Vec<String>,
pub tags: Vec<(String, String)>,
pub file_path: PathBuf,
pub hash: String,
pub is_enabled: bool,
}
Expand description
Contexts are a set of domains/URLs/etc. that restricts a search space to improve results.
Fields§
§name: String
Unique identifier for the lens
label: String
Human readable title for the lens
description: Option<String>
Optional description of the lens and what it contains.
domains: Vec<String>
Whole domains we want to be part of the index.
urls: Vec<String>
Specific URLs or URL prefixes that will be crawled
version: String
Semantic version of this lens (will be used to check for updates in the future).
rules: Vec<LensRule>
Rules to skip/constrain what URLs are indexed
trigger: String
§pipeline: Option<String>
§lens_source: LensSource
§categories: Vec<String>
Category(ies) this lens is in.
Tags to automatically apply to any URLs indexed by this lens
file_path: PathBuf
§hash: String
§is_enabled: bool
Implementations§
source§impl LensConfig
impl LensConfig
pub fn label(&self) -> String
pub fn into_regexes(&self) -> LensFilters
pub fn from_string(contents: &str) -> Result<Self>
pub fn from_path(path: PathBuf) -> Result<Self>
Trait Implementations§
source§impl Clone for LensConfig
impl Clone for LensConfig
source§fn clone(&self) -> LensConfig
fn clone(&self) -> LensConfig
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for LensConfig
impl Debug for LensConfig
source§impl Default for LensConfig
impl Default for LensConfig
source§fn default() -> LensConfig
fn default() -> LensConfig
Returns the “default value” for a type. Read more
source§impl<'de> Deserialize<'de> for LensConfig
impl<'de> Deserialize<'de> for LensConfig
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 RefUnwindSafe for LensConfig
impl Send for LensConfig
impl Sync for LensConfig
impl Unpin for LensConfig
impl UnwindSafe for LensConfig
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