Struct wasmprinter::PrintFmtWrite
source · pub struct PrintFmtWrite<T>(pub T);
Expand description
An adapter between the std::fmt::Write
trait and Print
.
Tuple Fields§
§0: T
Trait Implementations§
source§impl<T> Print for PrintFmtWrite<T>where
T: Write,
impl<T> Print for PrintFmtWrite<T>where
T: Write,
source§fn write_str(&mut self, s: &str) -> Result<()>
fn write_str(&mut self, s: &str) -> Result<()>
Writes the given string
s
in its entirety. Read moresource§fn start_line(&mut self, binary_offset: Option<usize>)
fn start_line(&mut self, binary_offset: Option<usize>)
Indicates that a new line in the output is starting at the
binary_offset
provided. Read moresource§fn write_fmt(&mut self, args: Arguments<'_>) -> Result<()>
fn write_fmt(&mut self, args: Arguments<'_>) -> Result<()>
Enables usage of
write!
with this trait.source§fn print_custom_section(
&mut self,
name: &str,
binary_offset: usize,
data: &[u8],
) -> Result<bool>
fn print_custom_section( &mut self, name: &str, binary_offset: usize, data: &[u8], ) -> Result<bool>
Helper to print a custom section, if needed. Read more
source§fn start_literal(&mut self) -> Result<()>
fn start_literal(&mut self) -> Result<()>
Sets the colors settings for literals (
"foo"
) to be printed.source§fn start_name(&mut self) -> Result<()>
fn start_name(&mut self) -> Result<()>
Sets the colors settings for a name (
$foo
) to be printed.source§fn start_keyword(&mut self) -> Result<()>
fn start_keyword(&mut self) -> Result<()>
Sets the colors settings for a keyword (
(module ...)
) to be printed.source§fn start_type(&mut self) -> Result<()>
fn start_type(&mut self) -> Result<()>
Sets the colors settings for a type (
(param i32)
) to be printed.source§fn start_comment(&mut self) -> Result<()>
fn start_comment(&mut self) -> Result<()>
Sets the colors settings for a comment (
;; ...
) to be printed.source§fn reset_color(&mut self) -> Result<()>
fn reset_color(&mut self) -> Result<()>
Resets colors settings to the default.
Auto Trait Implementations§
impl<T> Freeze for PrintFmtWrite<T>where
T: Freeze,
impl<T> RefUnwindSafe for PrintFmtWrite<T>where
T: RefUnwindSafe,
impl<T> Send for PrintFmtWrite<T>where
T: Send,
impl<T> Sync for PrintFmtWrite<T>where
T: Sync,
impl<T> Unpin for PrintFmtWrite<T>where
T: Unpin,
impl<T> UnwindSafe for PrintFmtWrite<T>where
T: UnwindSafe,
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