Skip to main content

MarkdownBody

Struct MarkdownBody 

Source
pub struct MarkdownBody {
    pub key: Option<KeyRef>,
    pub config: MarkdownConfig,
}
Expand description

Markdown laid out in a column, for a parent that scrolls or sizes it.

Fields§

§key: Option<KeyRef>§config: MarkdownConfig

fit_content is true by default.

Implementations§

Source§

impl MarkdownBody

Source

pub fn new(data: impl Into<String>) -> MarkdownBody

Renders the Markdown data.

Source§

impl MarkdownBody

Source

pub fn key(self, key: KeyRef) -> MarkdownBody

Sets the key.

Source

pub fn options(self, options: Options) -> MarkdownBody

Sets the extensions the text is parsed with.

Source

pub fn style_sheet(self, style_sheet: MarkdownStyleSheet) -> MarkdownBody

Sets the look, in place of the inherited DefaultMarkdownStyle.

Source

pub fn fit_content(self, fit_content: bool) -> MarkdownBody

Sets whether a block takes its content’s width rather than the full width.

Calls on_tap_link with a tapped link’s address and title.

Source

pub fn image( self, image: impl Fn(&mut App, &Image) -> WidgetRef + 'static, ) -> MarkdownBody

Builds each image with image.

Source

pub fn checkbox( self, checkbox: impl Fn(&mut App, bool) -> WidgetRef + 'static, ) -> MarkdownBody

Builds each task item’s checkbox with checkbox.

Source

pub fn bullet( self, bullet: impl Fn(&mut App, &Bullet) -> WidgetRef + 'static, ) -> MarkdownBody

Builds each list item’s bullet with bullet.

Source

pub fn highlight_code( self, highlight_code: impl Fn(&mut App, Option<&str>, &str) -> TextSpan + 'static, ) -> MarkdownBody

Spans each code block’s text with highlight_code.

Trait Implementations§

Source§

impl Debug for MarkdownBody

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl StatelessWidget for MarkdownBody

Source§

fn key(&self) -> Option<&KeyRef>

Source§

fn build(&self, _app: &mut App, _context: BuildContext) -> WidgetRef

Describes the part of the user interface represented by this widget. Read more
Source§

fn debug_fill_properties( &self, _app: &App, properties: &mut DiagnosticPropertiesBuilder, )

Dart’s debugFillProperties: the properties a dump shows for this widget, in Dart’s order. Dart’s Widget base only sets the dense tree style, which the framework does.
Source§

fn debug_check_constructor(&self)

Dart’s constructor asserts that relate two or more arguments. Read more
Source§

fn as_preferred_size_widget( &self, ) -> Option<&(dyn PreferredSizeWidget + 'static)>

Dart’s this is PreferredSizeWidget: a widget that implements PreferredSizeWidget answers with itself, which is what a parent asking an erased child for its preferred size reads.

Auto Trait Implementations§

§

impl !RefUnwindSafe for MarkdownBody

§

impl !Send for MarkdownBody

§

impl !Sync for MarkdownBody

§

impl !UnwindSafe for MarkdownBody

§

impl Forget for MarkdownBody

§

impl Freeze for MarkdownBody
where *const RcInner<dyn Key> is !null: Freeze, PhantomData<RcInner<dyn Key>>: Freeze, *const u8 is !null: Freeze, PhantomData<u8>: Freeze, InternalBitFlags: Freeze, &'static dyn ColorExtension: Freeze, *const RcInner<dyn ColorExtension> is !null: Freeze, PhantomData<RcInner<dyn ColorExtension>>: Freeze, PhantomData<String>: Freeze, *const RcInner<Paint> is !null: Freeze, PhantomData<RcInner<Paint>>: Freeze, PhantomData<Shadow>: Freeze, PhantomData<FontFeature>: Freeze, PhantomData<FontVariation>: Freeze, *const RcInner<dyn BoxBorder> is !null: Freeze, PhantomData<RcInner<dyn BoxBorder>>: Freeze, PhantomData<BoxShadow>: Freeze, *const RcInner<dyn Gradient> is !null: Freeze, PhantomData<RcInner<dyn Gradient>>: Freeze, *const RcInner<dyn TableColumnWidth> is !null: Freeze, PhantomData<RcInner<dyn TableColumnWidth>>: Freeze, *const RcInner<dyn Fn(&mut App, &str, &str)> is !null: Freeze, PhantomData<RcInner<dyn Fn(&mut App, &str, &str)>>: Freeze, *const RcInner<dyn Fn(&mut App, &Image) -> Rc<dyn Widget>> is !null: Freeze, PhantomData<RcInner<dyn Fn(&mut App, &Image) -> Rc<dyn Widget>>>: Freeze, *const RcInner<dyn Fn(&mut App, bool) -> Rc<dyn Widget>> is !null: Freeze, PhantomData<RcInner<dyn Fn(&mut App, bool) -> Rc<dyn Widget>>>: Freeze, *const RcInner<dyn Fn(&mut App, &Bullet) -> Rc<dyn Widget>> is !null: Freeze, PhantomData<RcInner<dyn Fn(&mut App, &Bullet) -> Rc<dyn Widget>>>: Freeze, *const RcInner<dyn Fn(&mut App, Option<&str>, &str) -> TextSpan> is !null: Freeze, PhantomData<RcInner<dyn Fn(&mut App, Option<&str>, &str) -> TextSpan>>: Freeze,

§

impl Move for MarkdownBody

§

impl Unpin for MarkdownBody
where Rc<dyn Key>: Unpin, *const u8 is !null: Unpin, InternalBitFlags: Unpin, &'static dyn ColorExtension: Unpin, Rc<dyn ColorExtension>: Unpin, Rc<Paint>: Unpin, Rc<dyn BoxBorder>: Unpin, Rc<dyn Gradient>: Unpin, Rc<dyn TableColumnWidth>: Unpin, Rc<dyn Fn(&mut App, &str, &str)>: Unpin, Rc<dyn Fn(&mut App, &Image) -> Rc<dyn Widget>>: Unpin, Rc<dyn Fn(&mut App, bool) -> Rc<dyn Widget>>: Unpin, Rc<dyn Fn(&mut App, &Bullet) -> Rc<dyn Widget>>: Unpin, Rc<dyn Fn(&mut App, Option<&str>, &str) -> TextSpan>: Unpin,

§

impl UnsafeUnpin for MarkdownBody
where *const RcInner<dyn Key> is !null: UnsafeUnpin, PhantomData<RcInner<dyn Key>>: UnsafeUnpin, *const u8 is !null: UnsafeUnpin, PhantomData<u8>: UnsafeUnpin, InternalBitFlags: UnsafeUnpin, &'static dyn ColorExtension: UnsafeUnpin, *const RcInner<dyn ColorExtension> is !null: UnsafeUnpin, PhantomData<RcInner<dyn ColorExtension>>: UnsafeUnpin, PhantomData<String>: UnsafeUnpin, *const RcInner<Paint> is !null: UnsafeUnpin, PhantomData<RcInner<Paint>>: UnsafeUnpin, PhantomData<Shadow>: UnsafeUnpin, PhantomData<FontFeature>: UnsafeUnpin, PhantomData<FontVariation>: UnsafeUnpin, *const RcInner<dyn BoxBorder> is !null: UnsafeUnpin, PhantomData<RcInner<dyn BoxBorder>>: UnsafeUnpin, PhantomData<BoxShadow>: UnsafeUnpin, *const RcInner<dyn Gradient> is !null: UnsafeUnpin, PhantomData<RcInner<dyn Gradient>>: UnsafeUnpin, *const RcInner<dyn TableColumnWidth> is !null: UnsafeUnpin, PhantomData<RcInner<dyn TableColumnWidth>>: UnsafeUnpin, *const RcInner<dyn Fn(&mut App, &str, &str)> is !null: UnsafeUnpin, PhantomData<RcInner<dyn Fn(&mut App, &str, &str)>>: UnsafeUnpin, *const RcInner<dyn Fn(&mut App, &Image) -> Rc<dyn Widget>> is !null: UnsafeUnpin, PhantomData<RcInner<dyn Fn(&mut App, &Image) -> Rc<dyn Widget>>>: UnsafeUnpin, *const RcInner<dyn Fn(&mut App, bool) -> Rc<dyn Widget>> is !null: UnsafeUnpin, PhantomData<RcInner<dyn Fn(&mut App, bool) -> Rc<dyn Widget>>>: UnsafeUnpin, *const RcInner<dyn Fn(&mut App, &Bullet) -> Rc<dyn Widget>> is !null: UnsafeUnpin, PhantomData<RcInner<dyn Fn(&mut App, &Bullet) -> Rc<dyn Widget>>>: UnsafeUnpin, *const RcInner<dyn Fn(&mut App, Option<&str>, &str) -> TextSpan> is !null: UnsafeUnpin, PhantomData<RcInner<dyn Fn(&mut App, Option<&str>, &str) -> TextSpan>>: 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
Source§

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

Source§

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

Source§

impl<T> Downcast<T> for T

Source§

fn downcast(&self) -> &T

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.

Source§

impl<W> IntoWidget<StatelessKind> for W
where W: StatelessWidget,

Source§

fn into_widget(self) -> Rc<dyn Widget>

The widget as a tree node, made where this is called: its creation_location.
Source§

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.
Source§

impl<T> Upcast<T> for T

Source§

fn upcast(&self) -> Option<&T>