pub struct DefaultViewer<'a, Theme> { /* private fields */ }Available on crate feature
markdown only.Expand description
The default Viewer.
Implementations§
Source§impl<'a, Theme> DefaultViewer<'a, Theme>
impl<'a, Theme> DefaultViewer<'a, Theme>
Sourcepub fn new(theme: Theme) -> DefaultViewer<'a, Theme>
pub fn new(theme: Theme) -> DefaultViewer<'a, Theme>
Creates a new DefaultViewer with the given Theme.
Sourcepub fn highlighter(
self,
highlighter: impl Highlighter<Code, Theme> + 'a,
) -> DefaultViewer<'a, Theme>
pub fn highlighter( self, highlighter: impl Highlighter<Code, Theme> + 'a, ) -> DefaultViewer<'a, Theme>
Sets a custom text::Highlighter for the DefaultViewer.
Trait Implementations§
Source§impl<'a, Theme, Renderer> Viewer<'a, String, Theme, Renderer> for DefaultViewer<'a, Theme>
impl<'a, Theme, Renderer> Viewer<'a, String, Theme, Renderer> for DefaultViewer<'a, Theme>
Source§fn highlighter(&self) -> &dyn Highlighter<Code, Theme>
fn highlighter(&self) -> &dyn Highlighter<Code, Theme>
The
text::Highlighter used for highligthing Code regions.Source§fn on_link_click(url: String) -> String
fn on_link_click(url: String) -> String
Produces a message when a link is clicked with the given
Uri.Source§fn image(
&self,
settings: Settings,
url: &'a String,
title: &'a str,
alt: &Text,
) -> Element<'a, Message, Theme, Renderer>
fn image( &self, settings: Settings, url: &'a String, title: &'a str, alt: &Text, ) -> Element<'a, Message, Theme, Renderer>
Displays an image. Read more
Source§fn heading(
&self,
settings: Settings,
level: &'a HeadingLevel,
text: &'a Text,
) -> Element<'a, Message, Theme, Renderer>
fn heading( &self, settings: Settings, level: &'a HeadingLevel, text: &'a Text, ) -> Element<'a, Message, Theme, Renderer>
Displays a heading. Read more
Source§fn paragraph(
&self,
settings: Settings,
text: &Text,
) -> Element<'a, Message, Theme, Renderer>
fn paragraph( &self, settings: Settings, text: &Text, ) -> Element<'a, Message, Theme, Renderer>
Displays a paragraph. Read more
Source§fn code_block(
&self,
settings: Settings,
language: Option<&'a str>,
code: &'a str,
lines: &'a [Text],
) -> Element<'a, Message, Theme, Renderer>
fn code_block( &self, settings: Settings, language: Option<&'a str>, code: &'a str, lines: &'a [Text], ) -> Element<'a, Message, Theme, Renderer>
Displays a code block. Read more
Source§fn unordered_list(
&self,
settings: Settings,
bullets: &'a [Bullet],
) -> Element<'a, Message, Theme, Renderer>
fn unordered_list( &self, settings: Settings, bullets: &'a [Bullet], ) -> Element<'a, Message, Theme, Renderer>
Displays an unordered list. Read more
Source§fn ordered_list(
&self,
settings: Settings,
start: u64,
bullets: &'a [Bullet],
) -> Element<'a, Message, Theme, Renderer>
fn ordered_list( &self, settings: Settings, start: u64, bullets: &'a [Bullet], ) -> Element<'a, Message, Theme, Renderer>
Displays an ordered list. Read more
Auto Trait Implementations§
impl<'a, Theme> Freeze for DefaultViewer<'a, Theme>where
Theme: Freeze,
impl<'a, Theme> !RefUnwindSafe for DefaultViewer<'a, Theme>
impl<'a, Theme> !Send for DefaultViewer<'a, Theme>
impl<'a, Theme> !Sync for DefaultViewer<'a, Theme>
impl<'a, Theme> Unpin for DefaultViewer<'a, Theme>where
Theme: Unpin,
impl<'a, Theme> UnsafeUnpin for DefaultViewer<'a, Theme>where
Theme: UnsafeUnpin,
impl<'a, Theme> !UnwindSafe for DefaultViewer<'a, Theme>
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
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<State, Message> IntoBoot<State, Message> for State
impl<State, Message> IntoBoot<State, Message> for State
Source§fn into_boot(self) -> (State, Task<Message>)
fn into_boot(self) -> (State, Task<Message>)
Turns some type into the initial state of some
Application.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