pub struct Tag { /* private fields */ }Expand description
A tag representing an IP address found in text.
Implementations§
Source§impl Tag
impl Tag
Sourcepub fn new<S: Into<String>, T: Into<String>>(matched: S, ip: T) -> Tag
pub fn new<S: Into<String>, T: Into<String>>(matched: S, ip: T) -> Tag
Create a new tag for an IP address.
matched is the raw text as it appeared in the haystack (may contain
defang brackets). ip is the clean, refanged IP address.
Sourcepub fn with_range(self, range: Range<usize>) -> Self
pub fn with_range(self, range: Range<usize>) -> Self
Set the byte range [start, end) where this tag was found in the original text.
Sourcepub fn with_decoration<S: Into<String>>(self, decorated: S) -> Self
pub fn with_decoration<S: Into<String>>(self, decorated: S) -> Self
Set a “decorated” version of the IP (e.g., with geolocation metadata).
This string will be used instead of the original IP when calling Tagged::write.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Tag
impl RefUnwindSafe for Tag
impl Send for Tag
impl Sync for Tag
impl Unpin for Tag
impl UnsafeUnpin for Tag
impl UnwindSafe for Tag
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