Skip to content

Commit

Permalink
Adds a type parameter getter (#122)
Browse files Browse the repository at this point in the history
* Adds a type parameter getter

* Adds a name parameter getter
  • Loading branch information
montekki authored Aug 5, 2021
1 parent b557d28 commit b8cb917
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/ty/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,18 @@ where
pub fn new(name: T::String, ty: Option<T::Type>) -> Self {
Self { name, ty }
}

/// Get the type of the parameter.
///
/// `None` if the parameter is skipped.
pub fn ty(&self) -> Option<&T::Type> {
self.ty.as_ref()
}

/// Get the name of the parameter.
pub fn name(&self) -> &T::String {
&self.name
}
}

/// The possible types a SCALE encodable Rust value could have.
Expand Down

0 comments on commit b8cb917

Please sign in to comment.