Struct doc_chunks::literalset::LiteralSet
source · 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
sourceimpl 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<'x>(&'x self) -> Vec<&'x TrimmedLiteral> ⓘ
pub fn literals<'x>(&'x self) -> Vec<&'x 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
sourceimpl Clone for LiteralSet
impl Clone for LiteralSet
sourcefn clone(&self) -> LiteralSet
fn clone(&self) -> LiteralSet
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moresourceimpl Debug for LiteralSet
impl Debug for LiteralSet
sourceimpl Default for LiteralSet
impl Default for LiteralSet
sourcefn default() -> LiteralSet
fn default() -> LiteralSet
Returns the “default value” for a type. Read more
sourceimpl<'s> Display for LiteralSet
impl<'s> Display for LiteralSet
sourceimpl Hash for LiteralSet
impl Hash for LiteralSet
sourceimpl PartialEq<LiteralSet> for LiteralSet
impl PartialEq<LiteralSet> for LiteralSet
sourcefn eq(&self, other: &LiteralSet) -> bool
fn eq(&self, other: &LiteralSet) -> bool
impl Eq for LiteralSet
impl StructuralEq for LiteralSet
impl StructuralPartialEq for LiteralSet
Auto Trait Implementations
impl RefUnwindSafe for LiteralSet
impl Send for LiteralSet
impl Sync for LiteralSet
impl Unpin for LiteralSet
impl UnwindSafe for LiteralSet
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
sourcefn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.