pub struct RustCodegen<'a> { /* private fields */ }Expand description
単一関数を生成するためのコード生成器(使い捨て)
各関数の生成ごとにフレッシュなインスタンスを作成して使用する。
生成中に不完全マーカーが出力された回数をカウントし、
生成完了時に GeneratedCode として結果を返す。
Implementations§
Source§impl<'a> RustCodegen<'a>
impl<'a> RustCodegen<'a>
Sourcepub fn new(
interner: &'a StringInterner,
enum_dict: &'a EnumDict,
macro_ctx: &'a MacroInferContext,
bindings_info: BindingsInfo,
known_symbols: &'a KnownSymbols,
rust_decl_dict: Option<&'a RustDeclDict>,
inline_fn_dict: Option<&'a InlineFnDict>,
) -> Self
pub fn new( interner: &'a StringInterner, enum_dict: &'a EnumDict, macro_ctx: &'a MacroInferContext, bindings_info: BindingsInfo, known_symbols: &'a KnownSymbols, rust_decl_dict: Option<&'a RustDeclDict>, inline_fn_dict: Option<&'a InlineFnDict>, ) -> Self
新しい単一関数用コード生成器を作成
Sourcepub fn with_perl_threaded(self, threaded: bool) -> Self
pub fn with_perl_threaded(self, threaded: bool) -> Self
対象 perl が threaded かを設定
Sourcepub fn with_dump_ast_for(self, name: Option<String>) -> Self
pub fn with_dump_ast_for(self, name: Option<String>) -> Self
AST ダンプ対象関数名を設定(デバッグ用)
pub fn with_dump_types_for(self, name: Option<String>) -> Self
Sourcepub fn with_fields_dict(self, dict: &'a FieldsDict) -> Self
pub fn with_fields_dict(self, dict: &'a FieldsDict) -> Self
FieldsDict への参照を設定
Sourcepub fn with_const_pointer_positions(self, positions: HashSet<usize>) -> Self
pub fn with_const_pointer_positions(self, positions: HashSet<usize>) -> Self
const ポインタ位置を設定
Sourcepub fn with_bool_return(
self,
is_bool: bool,
bool_macros: HashSet<InternedStr>,
) -> Self
pub fn with_bool_return( self, is_bool: bool, bool_macros: HashSet<InternedStr>, ) -> Self
bool 戻り値フラグと bool マクロ集合を設定
Sourcepub fn generate_macro(self, info: &MacroInferInfo) -> GeneratedCode
pub fn generate_macro(self, info: &MacroInferInfo) -> GeneratedCode
マクロ関数を生成(self を消費)
Sourcepub fn generate_inline_fn(
self,
name: InternedStr,
func_def: &FunctionDef,
) -> GeneratedCode
pub fn generate_inline_fn( self, name: InternedStr, func_def: &FunctionDef, ) -> GeneratedCode
inline 関数を生成(self を消費)
Auto Trait Implementations§
impl<'a> Freeze for RustCodegen<'a>
impl<'a> RefUnwindSafe for RustCodegen<'a>
impl<'a> Send for RustCodegen<'a>
impl<'a> Sync for RustCodegen<'a>
impl<'a> Unpin for RustCodegen<'a>
impl<'a> UnsafeUnpin for RustCodegen<'a>
impl<'a> UnwindSafe for RustCodegen<'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