pub struct StringMatchesCtx<'a> {
pub regex_caches: &'a mut RegexCaches,
pub exclusion_check: &'a ExclusionCheck<'a>,
pub excluded_matches: &'a mut AHashSet<String>,
pub match_emitter: &'a mut dyn MatchEmitter,
pub wildcard_indices: Option<&'a Vec<(usize, usize)>>,
pub per_string_data: &'a mut SharedData,
pub per_scanner_data: &'a SharedData,
pub per_event_data: &'a mut SharedData,
/* private fields */
}
Fields§
§regex_caches: &'a mut RegexCaches
§exclusion_check: &'a ExclusionCheck<'a>
§excluded_matches: &'a mut AHashSet<String>
§match_emitter: &'a mut dyn MatchEmitter
§wildcard_indices: Option<&'a Vec<(usize, usize)>>
§per_string_data: &'a mut SharedData
§per_scanner_data: &'a SharedData
§per_event_data: &'a mut SharedData
Implementations§
Source§impl StringMatchesCtx<'_>
impl StringMatchesCtx<'_>
Sourcepub fn process_async(
&self,
func: impl for<'a> FnOnce(&'a mut AsyncStringMatchesCtx) -> Pin<Box<dyn Future<Output = Result<(), ScannerError>> + Send + 'a>> + Send + 'static,
) -> RuleResult
pub fn process_async( &self, func: impl for<'a> FnOnce(&'a mut AsyncStringMatchesCtx) -> Pin<Box<dyn Future<Output = Result<(), ScannerError>> + Send + 'a>> + Send + 'static, ) -> RuleResult
If a get_string_matches
implementation needs to do any async processing (e.g. I/O),
this function can be used to return an “async job” to find matches. The return value
of process_async
should be returned from the get_string_matches
function. The future
passed into this function will be spawned and executed immediately without blocking
other get_string_matches
calls. This means all the async jobs will run concurrently.
The ctx
available to async jobs is more restrictive than the normal ctx
available in
get_string_matches
. The only thing you can do is return matches. If other data is needed,
it should be accessed before process_async
is called.
Auto Trait Implementations§
impl<'a> Freeze for StringMatchesCtx<'a>
impl<'a> !RefUnwindSafe for StringMatchesCtx<'a>
impl<'a> !Send for StringMatchesCtx<'a>
impl<'a> !Sync for StringMatchesCtx<'a>
impl<'a> Unpin for StringMatchesCtx<'a>
impl<'a> !UnwindSafe for StringMatchesCtx<'a>
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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