pub struct PerlTidyFormatter { /* private fields */ }Expand description
Perltidy formatter.
Implementations§
Source§impl PerlTidyFormatter
impl PerlTidyFormatter
Sourcepub fn new(
config: PerlTidyConfig,
runtime: Arc<dyn SubprocessRuntime>,
) -> PerlTidyFormatter
pub fn new( config: PerlTidyConfig, runtime: Arc<dyn SubprocessRuntime>, ) -> PerlTidyFormatter
Creates a new formatter with the given configuration and runtime.
Sourcepub fn with_os_runtime(config: PerlTidyConfig) -> PerlTidyFormatter
pub fn with_os_runtime(config: PerlTidyConfig) -> PerlTidyFormatter
Creates a new formatter with the OS subprocess runtime (non-WASM only).
Sourcepub fn clear_cache(&mut self)
pub fn clear_cache(&mut self)
Clear any memoized formatting results.
Sourcepub fn format_range(
&mut self,
code: &str,
start_line: u32,
end_line: u32,
) -> Result<String, String>
pub fn format_range( &mut self, code: &str, start_line: u32, end_line: u32, ) -> Result<String, String>
Format a range of code.
Sourcepub fn get_suggestions(
&mut self,
code: &str,
) -> Result<Vec<FormatSuggestion>, String>
pub fn get_suggestions( &mut self, code: &str, ) -> Result<Vec<FormatSuggestion>, String>
Get formatting suggestions without applying them.
Auto Trait Implementations§
impl Freeze for PerlTidyFormatter
impl !RefUnwindSafe for PerlTidyFormatter
impl Send for PerlTidyFormatter
impl Sync for PerlTidyFormatter
impl Unpin for PerlTidyFormatter
impl UnsafeUnpin for PerlTidyFormatter
impl !UnwindSafe for PerlTidyFormatter
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