Skip to main content

RustCodegen

Struct RustCodegen 

Source
pub struct RustCodegen<'a> { /* private fields */ }
Expand description

単一関数を生成するためのコード生成器(使い捨て)

各関数の生成ごとにフレッシュなインスタンスを作成して使用する。 生成中に不完全マーカーが出力された回数をカウントし、 生成完了時に GeneratedCode として結果を返す。

Implementations§

Source§

impl<'a> RustCodegen<'a>

Source

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

新しい単一関数用コード生成器を作成

Source

pub fn with_perl_threaded(self, threaded: bool) -> Self

対象 perl が threaded かを設定

Source

pub fn with_dump_ast_for(self, name: Option<String>) -> Self

AST ダンプ対象関数名を設定(デバッグ用)

Source

pub fn with_dump_types_for(self, name: Option<String>) -> Self

Source

pub fn with_fields_dict(self, dict: &'a FieldsDict) -> Self

FieldsDict への参照を設定

Source

pub fn with_const_pointer_positions(self, positions: HashSet<usize>) -> Self

const ポインタ位置を設定

Source

pub fn with_bool_return( self, is_bool: bool, bool_macros: HashSet<InternedStr>, ) -> Self

bool 戻り値フラグと bool マクロ集合を設定

Source

pub fn generate_macro(self, info: &MacroInferInfo) -> GeneratedCode

マクロ関数を生成(self を消費)

Source

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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.