pub(crate) struct CommentWriter {
enabled: bool,
global_comments: Vec<String>,
entity_comments: HashMap<AnyEntity, String>,
}
Fields§
§enabled: bool
§global_comments: Vec<String>
§entity_comments: HashMap<AnyEntity, String>
Implementations§
Source§impl CommentWriter
impl CommentWriter
pub(crate) fn new() -> Self
pub(crate) fn enabled(&self) -> bool
pub(crate) fn clear(&mut self)
pub(crate) fn add_global_comment<S: Into<String>>(&mut self, comment: S)
pub(crate) fn add_comment<S: Into<String> + AsRef<str>, E: Into<AnyEntity>>( &mut self, entity: E, comment: S, )
Trait Implementations§
Source§impl Clone for CommentWriter
impl Clone for CommentWriter
Source§fn clone(&self) -> CommentWriter
fn clone(&self) -> CommentWriter
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for CommentWriter
impl Debug for CommentWriter
Source§impl Default for CommentWriter
impl Default for CommentWriter
Source§impl FuncWriter for &CommentWriter
impl FuncWriter for &CommentWriter
Source§fn write_preamble(
&mut self,
w: &mut dyn Write,
func: &Function,
) -> Result<bool, Error>
fn write_preamble( &mut self, w: &mut dyn Write, func: &Function, ) -> Result<bool, Error>
Write the preamble to
w
. By default, this uses write_entity_definition
.Source§fn write_entity_definition(
&mut self,
w: &mut dyn Write,
_func: &Function,
entity: AnyEntity,
value: &dyn Display,
maybe_fact: Option<&Fact>,
) -> Result
fn write_entity_definition( &mut self, w: &mut dyn Write, _func: &Function, entity: AnyEntity, value: &dyn Display, maybe_fact: Option<&Fact>, ) -> Result
Write an entity definition defined in the preamble to
w
.Source§fn write_block_header(
&mut self,
w: &mut dyn Write,
func: &Function,
block: Block,
indent: usize,
) -> Result
fn write_block_header( &mut self, w: &mut dyn Write, func: &Function, block: Block, indent: usize, ) -> Result
Write the basic block header for the current function.
Source§fn write_instruction(
&mut self,
w: &mut dyn Write,
func: &Function,
aliases: &SecondaryMap<Value, Vec<Value>>,
inst: Inst,
indent: usize,
) -> Result
fn write_instruction( &mut self, w: &mut dyn Write, func: &Function, aliases: &SecondaryMap<Value, Vec<Value>>, inst: Inst, indent: usize, ) -> Result
Write the given
inst
to w
.Auto Trait Implementations§
impl Freeze for CommentWriter
impl RefUnwindSafe for CommentWriter
impl Send for CommentWriter
impl Sync for CommentWriter
impl Unpin for CommentWriter
impl UnwindSafe for CommentWriter
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Layout§
Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...)
attributes. Please see the Rust Reference's “Type Layout” chapter for details on type layout guarantees.
Size: 80 bytes