pub struct CodeBuilder<'a> { /* private fields */ }Expand description
Code Generator
Generate code based on the constructed Map and the provided sequence.
Implementations§
Source§impl<'a> CodeBuilder<'a>
impl<'a> CodeBuilder<'a>
Sourcepub fn new(
name: String,
hash: String,
u8seq_writer: &'a mut U8SeqWriter,
u32seq_writer: &'a mut U32SeqWriter,
) -> CodeBuilder<'a>
pub fn new( name: String, hash: String, u8seq_writer: &'a mut U8SeqWriter, u32seq_writer: &'a mut U32SeqWriter, ) -> CodeBuilder<'a>
Specifies the name, hash, and directory to use for the output map code.
Note that hash must be a fully qualified type path that implements
the HashOne trait
and is consistent with the algorithm used by MapBuilder.
Sourcepub fn set_visibility(&mut self, vis: Option<String>)
pub fn set_visibility(&mut self, vis: Option<String>)
This will configure the generated code as pub(vis).
pub fn create_custom(&mut self, name: String) -> ReferenceId
pub fn create_keys<SEQ, T>( &mut self, name: String, item_type: String, mapout: &MapOutput, seq: SEQ, ) -> Result<ReferenceId>
pub fn create_list<SEQ, T>( &mut self, name: String, item_type: String, seq: SEQ, ) -> Result<ReferenceId>
pub fn create_pair( &mut self, keys: ReferenceId, values: ReferenceId, ) -> ReferenceId
pub fn create_bytes_keys<SEQ, B>( &mut self, name: String, mapout: &MapOutput, seq: SEQ, ) -> Result<ReferenceId>
pub fn create_bytes_position_seq<SEQ, B>( &mut self, name: String, seq: SEQ, ) -> Result<ReferenceId>
pub fn create_u32_seq<SEQ>( &mut self, name: String, seq: SEQ, ) -> Result<ReferenceId>
pub fn create_short_id_seq<SEQ>( &mut self, name: String, pool: &ShortPool<'_>, seq: SEQ, ) -> Result<ReferenceId>
pub fn codegen(self, writer: &mut dyn Write) -> Result<()>
Auto Trait Implementations§
impl<'a> Freeze for CodeBuilder<'a>
impl<'a> RefUnwindSafe for CodeBuilder<'a>
impl<'a> Send for CodeBuilder<'a>
impl<'a> Sync for CodeBuilder<'a>
impl<'a> Unpin for CodeBuilder<'a>
impl<'a> !UnwindSafe for CodeBuilder<'a>
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