pub struct Token<T: Clone> { /* private fields */ }Available on crate feature
std only.Expand description
A token represents a searching string in the input data stream. If the
sequence of bytes search is found, then the response will be response.
Can optionally provide an escape_char, which will preclude search from
matching if it is immediately preceded by that character.
Can optionally provide an quote_char to indicate that search should be
precluded if wrapped in those characters.
Implementations§
Source§impl<T: Clone> Token<T>
impl<T: Clone> Token<T>
pub fn new<S: AsRef<[u8]>>(search: S, response: T) -> Self
pub fn with_escape_char(self, escape: u8) -> Self
pub fn with_quote_char(self, quote_char: QuotedChars) -> Self
pub fn get_search(&self) -> &[u8] ⓘ
pub fn get_response(&self) -> &T
Trait Implementations§
Auto Trait Implementations§
impl<T> Freeze for Token<T>where
T: Freeze,
impl<T> RefUnwindSafe for Token<T>where
T: RefUnwindSafe,
impl<T> Send for Token<T>where
T: Send,
impl<T> Sync for Token<T>where
T: Sync,
impl<T> Unpin for Token<T>where
T: Unpin,
impl<T> UnwindSafe for Token<T>where
T: UnwindSafe,
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