pub struct Uuid {}Trait Implementations§
Source§impl Finder for Uuid
impl Finder for Uuid
Source§fn line_agnostic(&self) -> bool
fn line_agnostic(&self) -> bool
Whether
try_at/try_trigger_at give the same answer on a whole
buffer as on the line alone: \n and \r never belong to a match,
and every walk treats them exactly like the end of the input (as a
boundary), so a match never depends on what surrounds its line. A
finder that matches “up to the end of the line” (codetag), accepts
line terminators as whitespace (JSON, phone) or otherwise looks at
the line as a whole must keep the default. Line-agnostic finders are
run over whole buffers with absolute positions, which lets the
scanner skip resolving the line of every candidate; property tests
compare both modes. Defaults to false.Source§fn dispatchable(&self) -> bool
fn dispatchable(&self) -> bool
Whether this finder supports dispatch-mode scanning via
try_at.Source§fn could_start_at(&self, byte: u8) -> bool
fn could_start_at(&self, byte: u8) -> bool
Whether the given byte could be the first byte of a match.
Only meaningful when
dispatchable returns true.Source§fn could_start_after(&self, prev: u8, _cur: u8) -> bool
fn could_start_after(&self, prev: u8, _cur: u8) -> bool
Whether a match could be attempted at byte
cur when the byte
immediately before it is prev: a dispatch-mode start, or a
trigger-mode trigger byte. Read moreSource§fn could_continue_with(&self, _cur: u8, next: u8) -> bool
fn could_continue_with(&self, _cur: u8, next: u8) -> bool
Whether an attempt at byte
cur could succeed when the byte
immediately after it is next. Same contract as
could_start_after.Source§fn anchor(&self) -> Option<Anchor>
fn anchor(&self) -> Option<Anchor>
Bytes every match of this dispatch finder contains (
bytes), and the
bytes that can separate a match start from the first of them
(walk). When every finder of a scanner declares an anchor (or is a
trigger finder) and the anchor bytes number three or fewer, the
scanner searches for those bytes with memchr, walks back over
walk and tries the dispatch positions in order, so lines without
an anchor byte cost nothing. Read moreSource§fn run_rules(&self) -> Vec<RunRule>
fn run_rules(&self) -> Vec<RunRule>
Rules on the digit or hex run starting at a candidate position,
evaluated with
RunRule::allow before try_at
is called. Same contract as
could_start_after: when the rules
reject a position, try_at must return None there. The scanner
measures the runs once per position for all finders.Source§fn try_at(&self, input: &[u8], pos: usize) -> Option<Range<usize>>
fn try_at(&self, input: &[u8], pos: usize) -> Option<Range<usize>>
Try to find a match starting exactly at
pos in the full input.
Only called when dispatchable returns true.Source§fn find(&self, s: &str) -> Option<Range<usize>>
fn find(&self, s: &str) -> Option<Range<usize>>
Finds the first match in the given string. Read more
Source§fn try_trigger_at_memo(
&self,
input: &[u8],
pos: usize,
memo: &mut Memo,
) -> Option<Range<usize>>
fn try_trigger_at_memo( &self, input: &[u8], pos: usize, memo: &mut Memo, ) -> Option<Range<usize>>
Source§fn triggerable(&self) -> bool
fn triggerable(&self) -> bool
Whether this finder supports trigger-mode scanning. Read more
Source§fn could_trigger_at(&self, _byte: u8) -> bool
fn could_trigger_at(&self, _byte: u8) -> bool
Whether the given byte could trigger a match for this finder.
Only meaningful when
triggerable returns true.Source§fn has_trigger_context(&self) -> bool
fn has_trigger_context(&self) -> bool
Whether the trigger context gate constrains anything: the scanner
then tabulates
trigger_context over the
65536 pairs of previous bytes and
trigger_context_exempt over the
next bytes, once, and consults them before calling the finder.
Defaults to false.Source§fn trigger_context(&self, _prev2: u8, _prev1: u8) -> bool
fn trigger_context(&self, _prev2: u8, _prev1: u8) -> bool
Whether a match may be triggered at a byte preceded by
prev2 and
prev1, unless the byte after the trigger is exempt
(trigger_context_exempt): a
necessary condition for try_trigger_at
to match at that position. The scanner passes a space for a missing
previous byte (the trigger sits in the first two bytes of the
input). Defaults to true.Source§fn trigger_context_exempt(&self, _next: Option<u8>) -> bool
fn trigger_context_exempt(&self, _next: Option<u8>) -> bool
Whether a trigger followed by
next (None at the end of the
input) escapes the previous-bytes condition: the URI finder needs a
registered scheme before a colon unless // follows. Defaults to
false.Source§fn try_trigger_at(&self, _input: &[u8], _pos: usize) -> Option<Range<usize>>
fn try_trigger_at(&self, _input: &[u8], _pos: usize) -> Option<Range<usize>>
Try to find a match triggered by
pos in the full input.
Only called when triggerable returns true.Auto Trait Implementations§
impl Freeze for Uuid
impl RefUnwindSafe for Uuid
impl Send for Uuid
impl Sync for Uuid
impl Unpin for Uuid
impl UnsafeUnpin for Uuid
impl UnwindSafe for Uuid
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