[−][src]Struct unsegen_pager::PagerContent
A collection of PagerLines
including information about the highlighting state and (if
present) a LineDecorator
.
Use from_lines
or from_file
to build an initial content and add highlighter and decorator
using with_highlighter
and with_decorator
.
Methods
impl<L: PagerLine> PagerContent<L, NoDecorator<L>>
[src]
pub fn from_lines(storage: Vec<L>) -> Self
[src]
Create a simple PagerContent
from a ordered collection of lines. The lines the Vec
will
be displayed top to bottom from beginning to end.
impl PagerContent<String, NoDecorator<String>>
[src]
pub fn from_file<F: AsRef<Path>>(file_path: F) -> Result<Self>
[src]
Try to load lines (as strings) from the given file as the lines of PagerContent.
impl<L, D> PagerContent<L, D> where
L: PagerLine,
D: LineDecorator<Line = L>,
[src]
L: PagerLine,
D: LineDecorator<Line = L>,
pub fn with_highlighter<HN: Highlighter>(
self,
highlighter: &HN
) -> PagerContent<L, D>
[src]
self,
highlighter: &HN
) -> PagerContent<L, D>
Add a Highlighter
to PagerContent
that previously did not have one.
impl<L> PagerContent<L, NoDecorator<L>> where
L: PagerLine,
[src]
L: PagerLine,
pub fn with_decorator<DN: LineDecorator<Line = L>>(
self,
decorator: DN
) -> PagerContent<L, DN>
[src]
self,
decorator: DN
) -> PagerContent<L, DN>
Add a Decorator
to PagerContent
that previously did not have one.
impl<L, D> PagerContent<L, D> where
L: PagerLine,
D: LineDecorator<Line = L>,
[src]
L: PagerLine,
D: LineDecorator<Line = L>,
pub fn view<'a, I: Into<LineIndex> + Clone, R: RangeBounds<I>>(
&'a self,
range: R
) -> impl DoubleEndedIterator<Item = (LineIndex, &'a L)> + 'a where
Self: Sized,
[src]
&'a self,
range: R
) -> impl DoubleEndedIterator<Item = (LineIndex, &'a L)> + 'a where
Self: Sized,
Iterate over a specified range of lines stored.
The specified range can be larger than what the PagerContent
currently holds. In that
case the additional indices are simply not part of the returned iterator.
pub fn view_line<I: Into<LineIndex>>(&self, line: I) -> Option<&L>
[src]
Try to view a specific line with the given index.
pub fn set_decorator(&mut self, decorator: D)
[src]
Overwrite the current decorator with a compatible one.
Auto Trait Implementations
impl<L, D> Unpin for PagerContent<L, D> where
D: Unpin,
L: Unpin,
D: Unpin,
L: Unpin,
impl<L, D> Sync for PagerContent<L, D> where
D: Sync,
L: Sync,
D: Sync,
L: Sync,
impl<L, D> Send for PagerContent<L, D> where
D: Send,
L: Send,
D: Send,
L: Send,
impl<L, D> RefUnwindSafe for PagerContent<L, D> where
D: RefUnwindSafe,
L: RefUnwindSafe,
D: RefUnwindSafe,
L: RefUnwindSafe,
impl<L, D> UnwindSafe for PagerContent<L, D> where
D: UnwindSafe,
L: UnwindSafe,
D: UnwindSafe,
L: UnwindSafe,
Blanket Implementations
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,