pub struct TokenLimitScanner { /* private fields */ }Expand description
Rejects input exceeding max_tokens approximate tokens.
Implementations§
Trait Implementations§
Source§impl Clone for TokenLimitScanner
impl Clone for TokenLimitScanner
Source§fn clone(&self) -> TokenLimitScanner
fn clone(&self) -> TokenLimitScanner
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for TokenLimitScanner
impl Debug for TokenLimitScanner
Source§impl Scanner for TokenLimitScanner
impl Scanner for TokenLimitScanner
Source§fn disposition(&self) -> Disposition
fn disposition(&self) -> Disposition
Whether this scanner may block, or only transforms.
Source§fn scan<'a>(&self, text: &'a str, _ctx: &mut ScanCtx) -> ScanResult<'a>
fn scan<'a>(&self, text: &'a str, _ctx: &mut ScanCtx) -> ScanResult<'a>
Inspect/transform
text. The borrowed Verdict::text lets a pure
detector return the input with zero allocation. Read moreSource§fn hold_back(&self) -> HoldBack
fn hold_back(&self) -> HoldBack
How much trailing text a streaming OUTPUT runner must hold back for this
scanner. Default
HoldBack::TokenBoundary — most patterns are
token-bounded. A full-text scanner overrides to HoldBack::WholeStream. Read moreSource§fn max_input_inflation_ratio(&self) -> f64
fn max_input_inflation_ratio(&self) -> f64
Token-inflation bound for an admission estimate (sentinels grow the
request). Default
1.0.Source§fn stream_patterns(&self) -> Vec<String>
fn stream_patterns(&self) -> Vec<String>
The regex patterns this scanner redacts (or blocks on) when it runs on
the OUTPUT path — the shapes the streaming runner’s hold-back DFA must
recognise so a match forming across a chunk boundary is never half-
emitted. Default empty: a scanner that never redacts streamed output (a
pure restore scanner, an input-only scanner) contributes nothing; the
runner still holds back live vault sentinels for restore independently. Read more
Auto Trait Implementations§
impl Freeze for TokenLimitScanner
impl RefUnwindSafe for TokenLimitScanner
impl Send for TokenLimitScanner
impl Sync for TokenLimitScanner
impl Unpin for TokenLimitScanner
impl UnsafeUnpin for TokenLimitScanner
impl UnwindSafe for TokenLimitScanner
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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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