pub struct SourceFormatter;Expand description
Pure型をフォーマット済みソースコードに変換するヘルパー
Implementations§
Source§impl SourceFormatter
impl SourceFormatter
Sourcepub fn format_fn_full(f: &PureFn) -> Result<String, ToSynError>
pub fn format_fn_full(f: &PureFn) -> Result<String, ToSynError>
PureFn → 完全なソース(body含む)
Sourcepub fn format_fn_signature(f: &PureFn) -> Result<String, ToSynError>
pub fn format_fn_signature(f: &PureFn) -> Result<String, ToSynError>
PureFn → シグネチャのみ(Defモード用)
Sourcepub fn format_struct(s: &PureStruct) -> Result<String, ToSynError>
pub fn format_struct(s: &PureStruct) -> Result<String, ToSynError>
PureStruct → 完全なソース
Sourcepub fn format_enum(e: &PureEnum) -> Result<String, ToSynError>
pub fn format_enum(e: &PureEnum) -> Result<String, ToSynError>
PureEnum → 完全なソース
Sourcepub fn format_trait(t: &PureTrait) -> Result<String, ToSynError>
pub fn format_trait(t: &PureTrait) -> Result<String, ToSynError>
PureTrait → 完全なソース
Sourcepub fn format_item_source(item: &PureItem) -> Result<String, ToSynError>
pub fn format_item_source(item: &PureItem) -> Result<String, ToSynError>
PureItem → 完全なソース
Sourcepub fn extract_doc(attrs: &[PureAttribute]) -> Option<String>
pub fn extract_doc(attrs: &[PureAttribute]) -> Option<String>
アトリビュートからドキュメントを抽出
Sourcepub fn extract_spec(attrs: &[PureAttribute]) -> Option<String>
pub fn extract_spec(attrs: &[PureAttribute]) -> Option<String>
アトリビュートから spec を抽出
Sourcepub fn extract_doc_and_spec(attrs: &[PureAttribute]) -> Option<String>
pub fn extract_doc_and_spec(attrs: &[PureAttribute]) -> Option<String>
ドキュメントとspec両方を抽出
Auto Trait Implementations§
impl Freeze for SourceFormatter
impl RefUnwindSafe for SourceFormatter
impl Send for SourceFormatter
impl Sync for SourceFormatter
impl Unpin for SourceFormatter
impl UnsafeUnpin for SourceFormatter
impl UnwindSafe for SourceFormatter
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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more