pub struct LiteralSet {
pub coverage: (usize, usize),
/* private fields */
}
Expand description
A set of consecutive literals.
Provides means to render them as a code block
Fields§
§coverage: (usize, usize)
lines spanned (start, end) inclusive
Implementations§
Source§impl LiteralSet
impl LiteralSet
Sourcepub fn from(literal: TrimmedLiteral) -> Self
pub fn from(literal: TrimmedLiteral) -> Self
Initiate a new set based on the first literal
Sourcepub fn add_adjacent(
&mut self,
literal: TrimmedLiteral,
) -> Result<(), TrimmedLiteral>
pub fn add_adjacent( &mut self, literal: TrimmedLiteral, ) -> Result<(), TrimmedLiteral>
Add a literal to a literal set, if the previous lines literal already exists.
Returns literal within the Err variant if not adjacent
Sourcepub fn literals(&self) -> Vec<&TrimmedLiteral>
pub fn literals(&self) -> Vec<&TrimmedLiteral>
The set of trimmed literals that is covered.
Sourcepub fn into_chunk(self) -> CheckableChunk
pub fn into_chunk(self) -> CheckableChunk
Convert to a checkable chunk.
Creates the map from content ranges to source spans.
Trait Implementations§
Source§impl Clone for LiteralSet
impl Clone for LiteralSet
Source§fn clone(&self) -> LiteralSet
fn clone(&self) -> LiteralSet
Returns a duplicate of the value. Read more
1.0.0 · Source§const fn clone_from(&mut self, source: &Self)
const fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for LiteralSet
impl Debug for LiteralSet
Source§impl Default for LiteralSet
impl Default for LiteralSet
Source§fn default() -> LiteralSet
fn default() -> LiteralSet
Returns the “default value” for a type. Read more
Source§impl<'s> Display for LiteralSet
impl<'s> Display for LiteralSet
Source§impl Hash for LiteralSet
impl Hash for LiteralSet
Source§impl PartialEq for LiteralSet
impl PartialEq for LiteralSet
impl Eq for LiteralSet
impl StructuralPartialEq for LiteralSet
Auto Trait Implementations§
impl Freeze for LiteralSet
impl RefUnwindSafe for LiteralSet
impl Send for LiteralSet
impl Sync for LiteralSet
impl Unpin for LiteralSet
impl UnwindSafe for LiteralSet
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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