Struct rg::subject::SubjectBuilder
source · pub struct SubjectBuilder {
config: Config,
}
Expand description
A builder for constructing things to search over.
Fields§
§config: Config
Implementations§
source§impl SubjectBuilder
impl SubjectBuilder
sourcepub fn new() -> SubjectBuilder
pub fn new() -> SubjectBuilder
Return a new subject builder with a default configuration.
sourcepub fn build_from_result(
&self,
result: Result<DirEntry, Error>
) -> Option<Subject>
pub fn build_from_result( &self, result: Result<DirEntry, Error> ) -> Option<Subject>
Create a new subject from a possibly missing directory entry.
If the directory entry isn’t present, then the corresponding error is logged if messages have been configured. Otherwise, if the subject is deemed searchable, then it is returned.
sourcepub fn build(&self, dent: DirEntry) -> Option<Subject>
pub fn build(&self, dent: DirEntry) -> Option<Subject>
Create a new subject using this builder’s configuration.
If a subject could not be created or should otherwise not be searched,
then this returns None
after emitting any relevant log messages.
sourcepub fn strip_dot_prefix(&mut self, yes: bool) -> &mut SubjectBuilder
pub fn strip_dot_prefix(&mut self, yes: bool) -> &mut SubjectBuilder
When enabled, if the subject’s file path starts with ./
then it is
stripped.
This is useful when implicitly searching the current working directory.
Trait Implementations§
source§impl Clone for SubjectBuilder
impl Clone for SubjectBuilder
source§fn clone(&self) -> SubjectBuilder
fn clone(&self) -> SubjectBuilder
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 moreAuto Trait Implementations§
impl RefUnwindSafe for SubjectBuilder
impl Send for SubjectBuilder
impl Sync for SubjectBuilder
impl Unpin for SubjectBuilder
impl UnwindSafe for SubjectBuilder
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