pub struct LearnerBuilder { /* private fields */ }
Expand description
Builder for creating configured Learner instances.
Provides a flexible way to construct Learner instances with custom configurations and paths.
§Examples
// Build with explicit config
let config = Config::default();
let learner = Learner::builder().with_config(config).build().await?;
// Or from a config path
let learner = Learner::builder().with_path("~/.learner").build().await?;
Implementations§
Source§impl LearnerBuilder
impl LearnerBuilder
Sourcepub fn with_config(self, config: Config) -> Self
pub fn with_config(self, config: Config) -> Self
Sourcepub async fn build(self) -> Result<Learner>
pub async fn build(self) -> Result<Learner>
Builds a new Learner
instance with the configured options.
This method:
- Resolves configuration from provided sources
- Ensures required directories exist
- Opens database connection
- Initializes paper retriever
§Errors
Returns error if:
- Configuration loading fails
- Directory creation fails
- Database initialization fails
- Retriever configuration fails
Trait Implementations§
Source§impl Default for LearnerBuilder
impl Default for LearnerBuilder
Source§fn default() -> LearnerBuilder
fn default() -> LearnerBuilder
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for LearnerBuilder
impl RefUnwindSafe for LearnerBuilder
impl Send for LearnerBuilder
impl Sync for LearnerBuilder
impl Unpin for LearnerBuilder
impl UnwindSafe for LearnerBuilder
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§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