pub struct ApidocEntry {
pub flags: ApidocFlags,
pub return_type: Option<String>,
pub name: String,
pub args: Vec<ApidocArg>,
pub source_file: Option<String>,
pub line_number: Option<usize>,
pub has_token_pasting: bool,
}Expand description
apidocエントリ(関数/マクロの定義)
Fields§
§flags: ApidocFlagsフラグ
return_type: Option<String>戻り値の型(なければNone)
name: String関数/マクロ名
args: Vec<ApidocArg>引数リスト
source_file: Option<String>ソースファイル(分かる場合)
line_number: Option<usize>行番号(分かる場合)
has_token_pasting: boolトークン合成を行うマクロか(引数型が "name" のような引用符付きの場合)
Implementations§
Source§impl ApidocEntry
impl ApidocEntry
Sourcepub fn parse_line(line: &str) -> Option<Self>
pub fn parse_line(line: &str) -> Option<Self>
単一行をパース(データ行のみ、コメントはNone) 形式: flags|return_type|name|arg1|arg2|…|argN
Sourcepub fn parse_apidoc_line(line: &str) -> Option<Self>
pub fn parse_apidoc_line(line: &str) -> Option<Self>
=for apidoc 行をパース 形式: =for apidoc name または: =for apidoc flags|return_type|name|arg1|…
Sourcepub fn is_public_api(&self) -> bool
pub fn is_public_api(&self) -> bool
この関数がAPI公開かどうか
Sourcepub fn is_type_param_keyword(ty: &str) -> bool
pub fn is_type_param_keyword(ty: &str) -> bool
型パラメータキーワードかどうかを判定
apidoc で type や cast は特殊な引数で、C の型名を表す。
Rust では generic 型パラメータとして扱う。
Sourcepub fn type_param_indices(&self) -> Vec<usize>
pub fn type_param_indices(&self) -> Vec<usize>
type/cast パラメータのインデックスを返す
Sourcepub fn returns_type_param(&self) -> bool
pub fn returns_type_param(&self) -> bool
戻り値型が type または cast かどうか
Sourcepub fn is_generic(&self) -> bool
pub fn is_generic(&self) -> bool
ジェネリック関数として生成すべきか
Sourcepub fn is_literal_string_keyword(ty: &str) -> bool
pub fn is_literal_string_keyword(ty: &str) -> bool
引数がリテラル文字列型かどうか(apidoc で "..." 形式の引数)
例: "literal string", "key", "message"
Rust では &str として扱う。
Sourcepub fn has_token_arg(&self) -> bool
pub fn has_token_arg(&self) -> bool
引数に token 型を持つかどうか
token 型の引数は ## によるトークン合成に使われるため、
このマクロは展開が必要(explicit_expand に追加すべき)
Trait Implementations§
Source§impl Clone for ApidocEntry
impl Clone for ApidocEntry
Source§fn clone(&self) -> ApidocEntry
fn clone(&self) -> ApidocEntry
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 ApidocEntry
impl Debug for ApidocEntry
Source§impl<'de> Deserialize<'de> for ApidocEntry
impl<'de> Deserialize<'de> for ApidocEntry
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for ApidocEntry
impl RefUnwindSafe for ApidocEntry
impl Send for ApidocEntry
impl Sync for ApidocEntry
impl Unpin for ApidocEntry
impl UnsafeUnpin for ApidocEntry
impl UnwindSafe for ApidocEntry
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