Skip to main content

FileSourceConfig

Struct FileSourceConfig 

Source
pub struct FileSourceConfig {
Show 13 fields pub source_id: SourceId, pub root: PathBuf, pub trust: f32, pub category_trust: HashMap<CategoryId, f32>, pub follow_links: bool, pub text_files_only: bool, pub group_by_directory: bool, pub title_replace_underscores: bool, pub include_date_aware_default_recipe: bool, pub index_dir: Option<PathBuf>, pub default_triplet_recipes: Vec<TripletRecipe>, pub taxonomy_builder: TaxonomyBuilder, pub section_builder: SectionBuilder,
}
Expand description

Configuration for a generic filesystem-backed data source.

Fields§

§source_id: SourceId

Stable source identifier used in records and persistence keys.

§root: PathBuf

Root directory containing source files.

§trust: f32

Default quality trust score applied to generated records.

§category_trust: HashMap<CategoryId, f32>

Optional trust overrides keyed by taxonomy segment.

§follow_links: bool

Whether to follow symlinks during index walking.

§text_files_only: bool

Whether indexing should include only text files.

§group_by_directory: bool

Whether deterministic directory grouping is enabled.

§title_replace_underscores: bool

Whether title extraction should replace underscores with spaces.

§include_date_aware_default_recipe: bool

Whether default recipe set includes the date-aware negative lane.

§index_dir: Option<PathBuf>

Optional directory used for persisted file-corpus index stores.

When None, file-corpus indexing uses the managed cache discovery root. Set this in tests to keep index writes inside temporary directories.

§default_triplet_recipes: Vec<TripletRecipe>

Optional default recipes returned by this source.

§taxonomy_builder: TaxonomyBuilder

Taxonomy builder invoked per file.

§section_builder: SectionBuilder

Section builder invoked per file.

Implementations§

Source§

impl FileSourceConfig

Source

pub fn new(source_id: impl Into<SourceId>, root: impl Into<PathBuf>) -> Self

Create a config for a filesystem source with explicit id and root.

Source

pub fn with_trust(self, trust: f32) -> Self

Override default trust score.

Source

pub fn with_category_trust( self, category: impl Into<String>, trust: f32, ) -> Self

Add a taxonomy-segment trust override.

Override whether symlinks are followed during index walk.

Source

pub fn with_text_files_only(self, text_files_only: bool) -> Self

Override whether index walk includes only text files.

Source

pub fn with_directory_grouping(self, group_by_directory: bool) -> Self

Enable or disable deterministic directory grouping.

Source

pub fn with_title_replace_underscores(self, replace_underscores: bool) -> Self

Set whether title extraction replaces underscores with spaces.

Source

pub fn with_date_aware_default_recipe(self, include: bool) -> Self

Enable/disable the date-aware default recipe lane (WrongPublicationDate).

“Date-aware” here uses publication-date metadata on records (for example taxonomy/meta date fields), not filesystem timestamps from source files.

Source

pub fn with_index_dir(self, index_dir: impl Into<PathBuf>) -> Self

Override the directory used to persist file-corpus index stores.

Source

pub fn with_default_triplet_recipes(self, recipes: Vec<TripletRecipe>) -> Self

Set source-provided default triplet recipes.

Source

pub fn with_taxonomy_builder(self, taxonomy_builder: TaxonomyBuilder) -> Self

Set a custom taxonomy builder.

Source

pub fn with_section_builder(self, section_builder: SectionBuilder) -> Self

Set a custom section builder.

Trait Implementations§

Source§

impl Clone for FileSourceConfig

Source§

fn clone(&self) -> FileSourceConfig

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more