pub struct RustDeclDict {
pub consts: HashMap<String, RustConst>,
pub fns: HashMap<String, RustFn>,
pub structs: HashMap<String, RustStruct>,
pub types: HashMap<String, RustTypeAlias>,
pub enums: HashSet<String>,
pub statics: HashSet<String>,
pub static_arrays: HashSet<String>,
pub static_types: HashMap<String, String>,
pub bitfield_methods: HashMap<String, HashSet<String>>,
pub bitfield_method_types: HashMap<(String, String), String>,
}Expand description
Rust宣言辞書
Fields§
§consts: HashMap<String, RustConst>§fns: HashMap<String, RustFn>§structs: HashMap<String, RustStruct>§types: HashMap<String, RustTypeAlias>§enums: HashSet<String>§statics: HashSet<String>全 extern static 変数名の集合
static_arrays: HashSet<String>配列型の extern static 変数名の集合
static_types: HashMap<String, String>static 変数の型マップ (名前 → Rust 型文字列) 例: “PL_c9_utf8_dfa_tab” → “[U8; 0usize]”
bitfield_methods: HashMap<String, HashSet<String>>ビットフィールドのメソッド名集合(構造体名 → メソッド名セット)
bitfield_method_types: HashMap<(String, String), String>ビットフィールドアクセサ getter の戻り値型 (構造体名, メソッド名) → 戻り値型文字列 例: (“op”, “op_type”) → “U16”
Implementations§
Source§impl RustDeclDict
impl RustDeclDict
Sourcepub fn parse_file<P: AsRef<Path>>(path: P) -> Result<Self>
pub fn parse_file<P: AsRef<Path>>(path: P) -> Result<Self>
ファイルからパース
Sourcepub fn intern_names(&self, interner: &mut StringInterner)
pub fn intern_names(&self, interner: &mut StringInterner)
全 struct / typedef / enum 名を StringInterner に intern する。
bindgen が生成する pmop__bindgen_ty_2 のような名前は通常 C ヘッダ側の
パースでは登場しないため interner に未登録のまま。後段の型推論で
from_apidoc_string("pmop__bindgen_ty_2", interner) のように
interner.lookup() を経由する経路は immutable な interner しか見ないので、
パース直後に明示的に intern しておく必要がある。
Sourcepub fn stats(&self) -> RustDeclStats
pub fn stats(&self) -> RustDeclStats
統計情報を取得
Sourcepub fn thx_functions(&self) -> HashSet<String>
pub fn thx_functions(&self) -> HashSet<String>
THX依存関数の名前を取得
第一引数が *mut PerlInterpreter を含む関数を返す
Sourcepub fn lookup_const(&self, name: &str) -> Option<&RustConst>
pub fn lookup_const(&self, name: &str) -> Option<&RustConst>
名前で定数を検索
Sourcepub fn lookup_struct(&self, name: &str) -> Option<&RustStruct>
pub fn lookup_struct(&self, name: &str) -> Option<&RustStruct>
名前で構造体を検索
Sourcepub fn lookup_type(&self, name: &str) -> Option<&RustTypeAlias>
pub fn lookup_type(&self, name: &str) -> Option<&RustTypeAlias>
名前で型エイリアスを検索
Trait Implementations§
Source§impl Debug for RustDeclDict
impl Debug for RustDeclDict
Source§impl Default for RustDeclDict
impl Default for RustDeclDict
Source§fn default() -> RustDeclDict
fn default() -> RustDeclDict
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for RustDeclDict
impl RefUnwindSafe for RustDeclDict
impl Send for RustDeclDict
impl Sync for RustDeclDict
impl Unpin for RustDeclDict
impl UnsafeUnpin for RustDeclDict
impl UnwindSafe for RustDeclDict
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