asmkit-rs 0.5.0

Portable assembler toolkit for encoding x86/x64, AArch64, and RISC-V
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
//! Formatter core functionality

/// An output for formatter.
pub trait FormatterOutput {
    fn write_str(&mut self, s: &str);
    fn write_fmt(&mut self, args: core::fmt::Arguments<'_>);
}

impl FormatterOutput for alloc::string::String {
    fn write_str(&mut self, s: &str) {
        self.push_str(s);
    }

    fn write_fmt(&mut self, args: core::fmt::Arguments<'_>) {
        core::fmt::write(self, args).unwrap();
    }
}