pub struct InteractContext<'a> {
pub matched: &'a str,
pub before: &'a str,
pub after: &'a str,
pub buffer: &'a str,
pub pattern_index: usize,
}Expand description
Context passed to pattern hook callbacks.
Fields§
§matched: &'a strThe matched text.
before: &'a strText before the match.
after: &'a strText after the match.
buffer: &'a strThe full buffer contents.
pattern_index: usizeThe pattern index that matched.
Implementations§
Source§impl InteractContext<'_>
impl InteractContext<'_>
Sourcepub fn send(&self, data: impl Into<String>) -> InteractAction
pub fn send(&self, data: impl Into<String>) -> InteractAction
Create a send action for convenience.
Sourcepub fn send_line(&self, data: impl Into<String>) -> InteractAction
pub fn send_line(&self, data: impl Into<String>) -> InteractAction
Create a send action with line ending.
Auto Trait Implementations§
impl<'a> Freeze for InteractContext<'a>
impl<'a> RefUnwindSafe for InteractContext<'a>
impl<'a> Send for InteractContext<'a>
impl<'a> Sync for InteractContext<'a>
impl<'a> Unpin for InteractContext<'a>
impl<'a> UnwindSafe for InteractContext<'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