pub struct Subject {
dent: DirEntry,
strip_dot_prefix: bool,
}
Expand description
A subject is a thing we want to search. Generally, a subject is either a file or stdin.
Fields§
§dent: DirEntry
§strip_dot_prefix: bool
Implementations§
source§impl Subject
impl Subject
sourcepub fn path(&self) -> &Path
pub fn path(&self) -> &Path
Return the file path corresponding to this subject.
If this subject corresponds to stdin, then a special <stdin>
path
is returned instead.
sourcepub fn is_explicit(&self) -> bool
pub fn is_explicit(&self) -> bool
Returns true if and only if this entry corresponds to a subject to search that was explicitly supplied by an end user.
Generally, this corresponds to either stdin or an explicit file path
argument. e.g., in rg foo some-file ./some-dir/
, some-file
is
an explicit subject, but, e.g., ./some-dir/some-other-file
is not.
However, note that ripgrep does not see through shell globbing. e.g.,
in rg foo ./some-dir/*
, ./some-dir/some-other-file
will be treated
as an explicit subject.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for Subject
impl Send for Subject
impl Sync for Subject
impl Unpin for Subject
impl !UnwindSafe for Subject
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