pub struct UrlRecognizer;Expand description
Recognizes HTTP, HTTPS, FTP, and www. URLs.
§Examples
use cloakrs_core::{EntityType, Recognizer};
use cloakrs_patterns::UrlRecognizer;
let findings = UrlRecognizer.scan("link: https://example.com/path");
assert_eq!(findings[0].entity_type, EntityType::Url);
assert_eq!(findings[0].text, "https://example.com/path");Trait Implementations§
Source§impl Clone for UrlRecognizer
impl Clone for UrlRecognizer
Source§fn clone(&self) -> UrlRecognizer
fn clone(&self) -> UrlRecognizer
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 UrlRecognizer
impl Debug for UrlRecognizer
Source§impl Default for UrlRecognizer
impl Default for UrlRecognizer
Source§fn default() -> UrlRecognizer
fn default() -> UrlRecognizer
Returns the “default value” for a type. Read more
Source§impl Recognizer for UrlRecognizer
impl Recognizer for UrlRecognizer
Source§fn entity_type(&self) -> EntityType
fn entity_type(&self) -> EntityType
The entity type this recognizer detects.
Source§fn supported_locales(&self) -> &[Locale]
fn supported_locales(&self) -> &[Locale]
Locales this recognizer applies to. Empty means universal.
impl Copy for UrlRecognizer
Auto Trait Implementations§
impl Freeze for UrlRecognizer
impl RefUnwindSafe for UrlRecognizer
impl Send for UrlRecognizer
impl Sync for UrlRecognizer
impl Unpin for UrlRecognizer
impl UnsafeUnpin for UrlRecognizer
impl UnwindSafe for UrlRecognizer
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