pub struct ResponseWithContext<'source> {
pub text: Cow<'source, str>,
pub response: Response,
pub text_length: usize,
}Expand description
Check response with additional context.
This structure exists to keep a link between a check response and the original text that was checked.
Fields§
§text: Cow<'source, str>Original text that was checked by LT.
response: ResponseCheck response.
text_length: usizeText’s length.
Implementations§
Source§impl<'source> ResponseWithContext<'source>
impl<'source> ResponseWithContext<'source>
Sourcepub fn new(text: Cow<'source, str>, response: Response) -> Self
pub fn new(text: Cow<'source, str>, response: Response) -> Self
Bind a check response with its original text.
Sourcepub fn iter_matches(&'source self) -> Iter<'source, Match>
pub fn iter_matches(&'source self) -> Iter<'source, Match>
Return an iterator over matches.
Sourcepub fn iter_matches_mut(&mut self) -> IterMut<'_, Match>
pub fn iter_matches_mut(&mut self) -> IterMut<'_, Match>
Return an iterator over mutable matches.
Sourcepub fn iter_match_positions(&self) -> MatchPositions<'_, '_, Iter<'_, Match>> ⓘ
pub fn iter_match_positions(&self) -> MatchPositions<'_, '_, Iter<'_, Match>> ⓘ
Return an iterator over matches and corresponding line number and line offset.
Trait Implementations§
Source§impl<'source> Clone for ResponseWithContext<'source>
impl<'source> Clone for ResponseWithContext<'source>
Source§fn clone(&self) -> ResponseWithContext<'source>
fn clone(&self) -> ResponseWithContext<'source>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<'source> Debug for ResponseWithContext<'source>
impl<'source> Debug for ResponseWithContext<'source>
Source§impl Deref for ResponseWithContext<'_>
impl Deref for ResponseWithContext<'_>
Source§impl<'source, 'response> From<&'source ResponseWithContext<'source>> for MatchPositions<'source, 'response, Iter<'response, Match>>where
'source: 'response,
impl<'source, 'response> From<&'source ResponseWithContext<'source>> for MatchPositions<'source, 'response, Iter<'response, Match>>where
'source: 'response,
Source§fn from(response: &'source ResponseWithContext<'_>) -> Self
fn from(response: &'source ResponseWithContext<'_>) -> Self
Converts to this type from the input type.
Source§impl<'source, 'response> From<&'source mut ResponseWithContext<'source>> for MatchPositions<'source, 'response, IterMut<'response, Match>>where
'source: 'response,
impl<'source, 'response> From<&'source mut ResponseWithContext<'source>> for MatchPositions<'source, 'response, IterMut<'response, Match>>where
'source: 'response,
Source§fn from(response: &'source mut ResponseWithContext<'_>) -> Self
fn from(response: &'source mut ResponseWithContext<'_>) -> Self
Converts to this type from the input type.
Source§impl<'source> From<ResponseWithContext<'source>> for Response
impl<'source> From<ResponseWithContext<'source>> for Response
Source§fn from(resp: ResponseWithContext<'source>) -> Self
fn from(resp: ResponseWithContext<'source>) -> Self
Converts to this type from the input type.
Source§impl<'source> IntoStatic for ResponseWithContext<'source>
impl<'source> IntoStatic for ResponseWithContext<'source>
type Static = ResponseWithContext<'static>
fn into_static(self) -> ResponseWithContext<'static>
Source§impl<'source> PartialEq for ResponseWithContext<'source>
impl<'source> PartialEq for ResponseWithContext<'source>
Source§fn eq(&self, other: &ResponseWithContext<'source>) -> bool
fn eq(&self, other: &ResponseWithContext<'source>) -> bool
Tests for
self and other values to be equal, and is used by ==.impl<'source> StructuralPartialEq for ResponseWithContext<'source>
Auto Trait Implementations§
impl<'source> Freeze for ResponseWithContext<'source>
impl<'source> RefUnwindSafe for ResponseWithContext<'source>
impl<'source> Send for ResponseWithContext<'source>
impl<'source> Sync for ResponseWithContext<'source>
impl<'source> Unpin for ResponseWithContext<'source>
impl<'source> UnwindSafe for ResponseWithContext<'source>
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more