forge_doc::writer::traits

Trait ParamLike

Source
pub(crate) trait ParamLike {
    // Required methods
    fn ty(&self) -> &Expression;
    fn name(&self) -> Option<&str>;

    // Provided method
    fn type_name(&self) -> String { ... }
}
Expand description

Helper trait to abstract over a solang type that can be documented as parameter

Required Methods§

Source

fn ty(&self) -> &Expression

Returns the type of the parameter.

Source

fn name(&self) -> Option<&str>

Returns the identifier of the parameter.

Provided Methods§

Source

fn type_name(&self) -> String

Returns the type as a string.

Implementations on Foreign Types§

Source§

impl ParamLike for ErrorParameter

Source§

fn ty(&self) -> &Expression

Source§

fn name(&self) -> Option<&str>

Source§

impl ParamLike for EventParameter

Source§

fn ty(&self) -> &Expression

Source§

fn name(&self) -> Option<&str>

Source§

impl ParamLike for Parameter

Source§

fn ty(&self) -> &Expression

Source§

fn name(&self) -> Option<&str>

Source§

impl ParamLike for VariableDeclaration

Source§

fn ty(&self) -> &Expression

Source§

fn name(&self) -> Option<&str>

Source§

impl<T> ParamLike for &T
where T: ParamLike,

Source§

fn ty(&self) -> &Expression

Source§

fn name(&self) -> Option<&str>

Implementors§