ClosureMapDataVisitor

Struct ClosureMapDataVisitor 

Source
pub struct ClosureMapDataVisitor<T, U, F>
where F: FnMut(T) -> U,
{ /* private fields */ }
Expand description

Simple implementation using a closure

Implementations§

Source§

impl<T, U, F> ClosureMapDataVisitor<T, U, F>
where F: FnMut(T) -> U,

Source

pub fn new(f: F) -> Self

Trait Implementations§

Source§

impl<T, U, F> MapDataVisitor<T, U> for ClosureMapDataVisitor<T, U, F>
where F: FnMut(T) -> U,

Source§

fn map_data(&mut self, data: T) -> U

Transform user data
Source§

fn visit_document(&mut self, doc: Document<T>) -> Document<U>

Transform a document
Source§

fn visit_block(&mut self, block: Block<T>) -> Block<U>

Transform a block
Source§

fn visit_inline(&mut self, inline: Inline<T>) -> Inline<U>

Transform an inline element
Source§

fn visit_heading(&mut self, heading: Heading<T>) -> Heading<U>

Transform a heading
Source§

fn visit_list(&mut self, list: List<T>) -> List<U>

Transform a list
Source§

fn visit_list_item(&mut self, item: ListItem<T>) -> ListItem<U>

Transform a list item
Source§

fn visit_code_block(&mut self, code_block: CodeBlock<T>) -> CodeBlock<U>

Transform a code block
Transform a link definition
Source§

fn visit_table(&mut self, table: Table<T>) -> Table<U>

Transform a table
Source§

fn visit_footnote_definition( &mut self, footnote: FootnoteDefinition<T>, ) -> FootnoteDefinition<U>

Transform a footnote definition
Source§

fn visit_github_alert( &mut self, alert: GitHubAlertNode<T>, ) -> GitHubAlertNode<U>

Transform a GitHub alert
Transform a link
Source§

fn visit_image(&mut self, image: Image<T>) -> Image<U>

Transform an image
Transform a link reference

Auto Trait Implementations§

§

impl<T, U, F> Freeze for ClosureMapDataVisitor<T, U, F>
where F: Freeze,

§

impl<T, U, F> RefUnwindSafe for ClosureMapDataVisitor<T, U, F>

§

impl<T, U, F> Send for ClosureMapDataVisitor<T, U, F>
where F: Send, T: Send, U: Send,

§

impl<T, U, F> Sync for ClosureMapDataVisitor<T, U, F>
where F: Sync, T: Sync, U: Sync,

§

impl<T, U, F> Unpin for ClosureMapDataVisitor<T, U, F>
where F: Unpin, T: Unpin, U: Unpin,

§

impl<T, U, F> UnwindSafe for ClosureMapDataVisitor<T, U, F>
where F: UnwindSafe, T: UnwindSafe, U: UnwindSafe,

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<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<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.