shared-vec 0.1.0

Efficient shared container types
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#![cfg(feature = "miette")]

use crate::{Counter, String};
use alloc::boxed::Box;
use miette::{MietteError, SourceCode, SourceSpan, SpanContents};

impl<C: Counter<usize> + Send + Sync> SourceCode for String<C> {
    #[inline]
    fn read_span<'a>(
        &'a self,
        span: &SourceSpan,
        context_lines_before: usize,
        context_lines_after: usize,
    ) -> Result<Box<dyn SpanContents<'a> + 'a>, MietteError> {
        <str as SourceCode>::read_span(self, span, context_lines_before, context_lines_after)
    }
}