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>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
pub fn literals<'x>(&'x self) -> Vec<&'x TrimmedLiteral>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
A: Allocator,
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 more
sourceimpl 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
This method tests for self and other values to be equal, and is used
by ==. Read more
sourcefn ne(&self, other: &LiteralSet) -> bool
fn ne(&self, other: &LiteralSet) -> bool
This method tests for !=.
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 T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
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 Q where
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Q where
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.
impl<T> Pointable for T
impl<T> Pointable for T
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into)Uses borrowed data to replace owned data, usually by cloning. Read more