You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

25 lines
636 B
Rust

4 years ago
use super::Section;
use crate::error::Error;
4 years ago
pub trait Output {
fn allocate(&mut self, size: u64) -> Result<u64, Error>;
fn append_section(&mut self, section: &Section) -> Result<(), Error>;
// fn prepare_symbol<V, S>(&mut self, symbol: impl Lazy<V, S>) -> Result<&mut Self, Error>;
}
pub struct DummyOutput;
impl Output for DummyOutput {
fn allocate(&mut self, size: u64) -> Result<u64, Error> {
eprintln!("Allocating: {}", size);
Ok(size)
}
fn append_section(&mut self, section: &Section) -> Result<(), Error> {
eprintln!("Appending section: {}", section);
Ok(())
}
}