pub struct Scanner { /* private fields */ }
Implementations§
Source§impl Scanner
impl Scanner
pub fn new(config: Config) -> Self
Sourcepub fn scan(&mut self, input: &str) -> Result<Vec<FoundSecret>, MinosCodexError>
pub fn scan(&mut self, input: &str) -> Result<Vec<FoundSecret>, MinosCodexError>
Examples found in repository?
examples/basic_usage.rs (line 15)
10fn run() -> Result<(), MinosCodexError> {
11 let mut scanner = create_scanner()?;
12
13 let input = "My email is example@email.com and my AWS access key is AKIAIOSFODNN7EXAMPLE";
14
15 let found_secrets = scanner.scan(input)?;
16
17 if found_secrets.is_empty() {
18 println!("No secrets found.");
19 } else {
20 println!("Found secrets:");
21 for secret in found_secrets {
22 println!(" Type: {}", secret.secret_type);
23 println!(" Value: {}", secret.value);
24 println!(" Position: {}:{}", secret.start, secret.end);
25 println!();
26 }
27 }
28
29 Ok(())
30}
Auto Trait Implementations§
impl Freeze for Scanner
impl RefUnwindSafe for Scanner
impl Send for Scanner
impl Sync for Scanner
impl Unpin for Scanner
impl UnwindSafe for Scanner
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