pub struct FilesystemConnector {
name: String,
config: FilesystemConnectorConfig,
}Expand description
A filesystem connector instance that implements the Connector trait.
Wraps the scan_filesystem function, allowing filesystem connectors
to be used through the unified trait-based dispatch.
§Example
use context_harness::connector_fs::FilesystemConnector;
use context_harness::config::FilesystemConnectorConfig;
use context_harness::traits::Connector;
let config: FilesystemConnectorConfig = toml::from_str(r#"
root = "./docs"
include_globs = ["**/*.md"]
"#).unwrap();
let connector = FilesystemConnector::new("docs".into(), config);
assert_eq!(connector.source_label(), "filesystem:docs");Fields§
§name: StringInstance name (e.g. "docs").
config: FilesystemConnectorConfigConfiguration for this filesystem connector instance.
Implementations§
Source§impl FilesystemConnector
impl FilesystemConnector
Sourcepub fn new(name: String, config: FilesystemConnectorConfig) -> Self
pub fn new(name: String, config: FilesystemConnectorConfig) -> Self
Create a new filesystem connector instance.
Trait Implementations§
Source§impl Connector for FilesystemConnector
impl Connector for FilesystemConnector
Source§fn description(&self) -> &str
fn description(&self) -> &str
Returns a one-line description of what this connector does. Read more
Source§fn connector_type(&self) -> &str
fn connector_type(&self) -> &str
Source§fn scan<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<SourceItem>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn scan<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<SourceItem>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Scan the data source and return all items to ingest. Read more
Source§fn source_label(&self) -> String
fn source_label(&self) -> String
Returns the source label used to tag documents from this connector. Read more
Auto Trait Implementations§
impl Freeze for FilesystemConnector
impl RefUnwindSafe for FilesystemConnector
impl Send for FilesystemConnector
impl Sync for FilesystemConnector
impl Unpin for FilesystemConnector
impl UnwindSafe for FilesystemConnector
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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