pub struct PrefixComparator<'a> { /* private fields */ }Expand description
A comparator that tracks the best matching prefix between two strings.
Implementations§
Source§impl<'a> PrefixComparator<'a>
impl<'a> PrefixComparator<'a>
Sourcepub fn common_prefix_len(&self) -> usize
pub fn common_prefix_len(&self) -> usize
Returns the length of the longest common prefix.
Sourcepub fn common_prefix(&self) -> &'a str
pub fn common_prefix(&self) -> &'a str
Returns the common prefix as a string slice of left.
Auto Trait Implementations§
impl<'a> Freeze for PrefixComparator<'a>
impl<'a> RefUnwindSafe for PrefixComparator<'a>
impl<'a> Send for PrefixComparator<'a>
impl<'a> Sync for PrefixComparator<'a>
impl<'a> Unpin for PrefixComparator<'a>
impl<'a> UnsafeUnpin for PrefixComparator<'a>
impl<'a> UnwindSafe for PrefixComparator<'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