Struct tvix_castore::refscan::ReferenceScanner
source · pub struct ReferenceScanner<P> {
pattern: ReferencePattern<P>,
matches: Vec<AtomicBool>,
}
Expand description
Represents a “primed” reference scanner with an automaton that knows the set of bytes patterns to scan for.
Fields§
§pattern: ReferencePattern<P>
§matches: Vec<AtomicBool>
Implementations§
source§impl<P: AsRef<[u8]>> ReferenceScanner<P>
impl<P: AsRef<[u8]>> ReferenceScanner<P>
sourcepub fn new<IP: Into<ReferencePattern<P>>>(pattern: IP) -> Self
pub fn new<IP: Into<ReferencePattern<P>>>(pattern: IP) -> Self
Construct a new ReferenceScanner
that knows how to scan for the given
candidate bytes patterns.
sourcepub fn scan<S: AsRef<[u8]>>(&self, haystack: S)
pub fn scan<S: AsRef<[u8]>>(&self, haystack: S)
Scan the given buffer for all non-overlapping matches and collect them in the scanner.
pub fn pattern(&self) -> &ReferencePattern<P>
pub fn matches(&self) -> Vec<bool>
pub fn candidate_matches(&self) -> impl Iterator<Item = &P>
Auto Trait Implementations§
impl<P> Freeze for ReferenceScanner<P>
impl<P> RefUnwindSafe for ReferenceScanner<P>where
P: RefUnwindSafe,
impl<P> Send for ReferenceScanner<P>
impl<P> Sync for ReferenceScanner<P>
impl<P> Unpin for ReferenceScanner<P>
impl<P> UnwindSafe for ReferenceScanner<P>where
P: RefUnwindSafe,
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> FutureExt for T
impl<T> FutureExt for T
source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
source§impl<T> FutureExt for T
impl<T> FutureExt for T
source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§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 moresource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T
in a tonic::Request