pub struct OutputToString { /* private fields */ }
Expand description
Helper structure to help maintain an indentation level when printing source,
modeled after the support in wit-bindgen-core
. Indentation is set to two spaces.
Trait Implementations§
Source§impl Default for OutputToString
impl Default for OutputToString
Source§fn default() -> OutputToString
fn default() -> OutputToString
Returns the “default value” for a type. Read more
Source§impl Display for OutputToString
impl Display for OutputToString
Source§impl From<OutputToString> for String
impl From<OutputToString> for String
Source§fn from(output: OutputToString) -> String
fn from(output: OutputToString) -> String
Converts to this type from the input type.
Source§impl Output for OutputToString
impl Output for OutputToString
Source§fn indent_if_needed(&mut self) -> bool
fn indent_if_needed(&mut self) -> bool
Set the appropriate indentation. Read more
Source§fn indent_start(&mut self)
fn indent_start(&mut self)
Start of indentation. In WIT this represents
{\n
.Source§fn indent_end(&mut self)
fn indent_end(&mut self)
End of indentation. In WIT this represents
}\n
.Source§fn indent_and_print(&mut self, src: &str)
fn indent_and_print(&mut self, src: &str)
This method is designed to be used only by the default methods of this trait.
Called only from the default implementation functions of this trait.
Source§fn keyword(&mut self, src: &str)
fn keyword(&mut self, src: &str)
A keyword is added. Keywords are hardcoded strings from
[a-z]
, but can start with @
when printing a Feature GateSource§fn param(&mut self, src: &str)
fn param(&mut self, src: &str)
A parameter name of a function, record or a named return is added.
Source§fn generic_args_start(&mut self)
fn generic_args_start(&mut self)
Generic argument section starts. In WIT this represents the
<
character.Source§fn generic_args_end(&mut self)
fn generic_args_end(&mut self)
Generic argument section ends. In WIT this represents the ‘>’ character.
Auto Trait Implementations§
impl Freeze for OutputToString
impl RefUnwindSafe for OutputToString
impl Send for OutputToString
impl Sync for OutputToString
impl Unpin for OutputToString
impl UnwindSafe for OutputToString
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