pub struct Corpus { /* private fields */ }Expand description
A validated corpus of shell commands
Implementations§
Source§impl Corpus
impl Corpus
Sourcepub fn load<P: AsRef<Path>>(path: P) -> CorpusResult<Self>
pub fn load<P: AsRef<Path>>(path: P) -> CorpusResult<Self>
Load corpus from a file, validating for sensitive data
Sourcepub fn from_string(content: &str) -> CorpusResult<Self>
pub fn from_string(content: &str) -> CorpusResult<Self>
Create corpus from string content
Sourcepub fn prefixes(&self) -> &HashSet<String>
pub fn prefixes(&self) -> &HashSet<String>
Get unique command prefixes (first word of each command)
Sourcepub fn coverage_stats(&self) -> CorpusStats
pub fn coverage_stats(&self) -> CorpusStats
Get coverage statistics
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Corpus
impl RefUnwindSafe for Corpus
impl Send for Corpus
impl Sync for Corpus
impl Unpin for Corpus
impl UnwindSafe for Corpus
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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