Skip to main content

SelectableViewer

Struct SelectableViewer 

Source
pub struct SelectableViewer<'a, Theme> { /* private fields */ }
Expand description

The default Viewer.

Implementations§

Source§

impl<'a, Theme> SelectableViewer<'a, Theme>

Source

pub fn new(theme: Theme) -> Self

Creates a new SelectableViewer with the given Theme.

Source

pub fn highlighter( self, highlighter: impl Highlighter<Code, Theme> + 'a, ) -> Self

Sets a custom text::Highlighter for the SelectableViewer.

Trait Implementations§

Source§

impl<'a, Theme, Renderer> Viewer<'a, String, Theme, Renderer> for SelectableViewer<'a, Theme>
where Theme: Catalog + Catalog + 'a, Renderer: Renderer<Paragraph = Paragraph> + 'a,

Source§

fn theme(&self) -> &Theme

The Theme used for styling the Markdown elements.
Source§

fn highlighter(&self) -> &dyn Highlighter<Code, Theme>

The text::Highlighter used for highligthing Code regions.
Produces a message when a link is clicked with the given Uri.
Source§

fn heading( &self, settings: Settings, level: &'a HeadingLevel, text: &'a Text, ) -> impl Widget<Uri, Theme, Renderer> + 'a

Displays a heading. Read more
Source§

fn paragraph( &self, settings: Settings, text: &Text, ) -> impl Widget<Uri, Theme, Renderer> + 'a

Displays a paragraph. Read more
Source§

fn unordered_list( &self, settings: Settings, items: &'a [Bullet], ) -> impl Widget<Uri, Theme, Renderer> + 'a

Displays an unordered list. Read more
Source§

fn ordered_list( &self, settings: Settings, start: u64, items: &'a [Bullet], ) -> impl Widget<Uri, Theme, Renderer> + 'a

Displays an ordered list. Read more
Source§

fn code_block( &self, settings: Settings, _language: Option<&'a str>, _code: &'a str, lines: &'a [Text], ) -> impl Widget<Uri, Theme, Renderer> + 'a

Displays a code block. Read more
Source§

fn image( &self, settings: Settings, url: &'a String, title: &'a str, alt: &Text, ) -> impl Widget<Message, Theme, Renderer> + 'a

Displays an image. Read more
Source§

fn quote( &self, settings: Settings, contents: &'a [Item], ) -> impl Widget<Message, Theme, Renderer> + 'a

Displays a quote. Read more
Source§

fn rule(&self) -> impl Widget<Message, Theme, Renderer> + 'a

Displays a rule. Read more
Source§

fn table( &self, settings: Settings, columns: &'a [Column], rows: &'a [Row], ) -> impl Widget<Message, Theme, Renderer> + 'a

Displays a table. Read more

Auto Trait Implementations§

§

impl<'a, Theme> !RefUnwindSafe for SelectableViewer<'a, Theme>

§

impl<'a, Theme> !Send for SelectableViewer<'a, Theme>

§

impl<'a, Theme> !Sync for SelectableViewer<'a, Theme>

§

impl<'a, Theme> !UnwindSafe for SelectableViewer<'a, Theme>

§

impl<'a, Theme> Freeze for SelectableViewer<'a, Theme>
where Theme: Freeze, Option<Box<dyn Highlighter<Code, Theme> + 'a>>: Freeze,

§

impl<'a, Theme> Unpin for SelectableViewer<'a, Theme>
where Theme: Unpin, Option<Box<dyn Highlighter<Code, Theme> + 'a>>: Unpin,

§

impl<'a, Theme> UnsafeUnpin for SelectableViewer<'a, Theme>
where Theme: UnsafeUnpin, Option<Box<dyn Highlighter<Code, Theme> + 'a>>: UnsafeUnpin,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.