[][src]Struct dprint_core::plugins::Formatter

pub struct Formatter { /* fields omitted */ }

A formatter constructed from a collection of plugins.

Implementations

impl Formatter[src]

pub fn new(plugins: Vec<Box<dyn Plugin>>) -> Formatter[src]

Creates a new formatter

pub fn iter_plugins(&self) -> Iter<Box<dyn Plugin>>[src]

Iterates over the plugins.

pub fn iter_plugins_mut(&mut self) -> IterMut<Box<dyn Plugin>>[src]

Iterates over the plugins with a mutable iterator.

pub fn format_text(
    &self,
    file_path: &PathBuf,
    file_text: &str
) -> Result<Option<String>, String>
[src]

Formats the file text with one of the plugins.

Returns the string when a plugin formatted or error. Otherwise None when no plugin was found.

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.