Struct PrintFmtWrite
pub(crate) struct PrintFmtWrite<T>(pub T);Expand description
An adapter between the std::fmt::Write trait and [Print].
Tuple Fields§
§0: TTrait Implementations§
§impl<T> Print for PrintFmtWrite<T>where
T: Write,
impl<T> Print for PrintFmtWrite<T>where
T: Write,
§fn write_str(&mut self, s: &str) -> Result<(), Error>
fn write_str(&mut self, s: &str) -> Result<(), Error>
Writes the given string
s in its entirety. Read more§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 more§fn write_fmt(&mut self, args: Arguments<'_>) -> Result<(), Error>
fn write_fmt(&mut self, args: Arguments<'_>) -> Result<(), Error>
Enables usage of
write! with this trait.§fn print_custom_section(
&mut self,
name: &str,
binary_offset: usize,
data: &[u8],
) -> Result<bool, Error>
fn print_custom_section( &mut self, name: &str, binary_offset: usize, data: &[u8], ) -> Result<bool, Error>
Helper to print a custom section, if needed. Read more
§fn start_literal(&mut self) -> Result<(), Error>
fn start_literal(&mut self) -> Result<(), Error>
Sets the colors settings for literals (
"foo") to be printed.§fn start_name(&mut self) -> Result<(), Error>
fn start_name(&mut self) -> Result<(), Error>
Sets the colors settings for a name (
$foo) to be printed.§fn start_keyword(&mut self) -> Result<(), Error>
fn start_keyword(&mut self) -> Result<(), Error>
Sets the colors settings for a keyword (
(module ...)) to be printed.§fn start_type(&mut self) -> Result<(), Error>
fn start_type(&mut self) -> Result<(), Error>
Sets the colors settings for a type (
(param i32)) to be printed.§fn start_comment(&mut self) -> Result<(), Error>
fn start_comment(&mut self) -> Result<(), Error>
Sets the colors settings for a comment (
;; ...) to be printed.§fn reset_color(&mut self) -> Result<(), Error>
fn reset_color(&mut self) -> Result<(), Error>
Resets colors settings to the default.
§fn supports_async_color(&self) -> bool
fn supports_async_color(&self) -> bool
Returns
true if the device uses colors without interacting synchronously with a terminal (e.g. ANSI)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