pub struct TypedParam {
pub name: String,
pub type_expr: Option<TypeExpr>,
pub default_value: Option<Box<SNode>>,
}Expand description
A parameter with an optional type annotation and optional default value.
Fields§
§name: String§type_expr: Option<TypeExpr>§default_value: Option<Box<SNode>>Implementations§
Source§impl TypedParam
impl TypedParam
Sourcepub fn names(params: &[TypedParam]) -> Vec<String>
pub fn names(params: &[TypedParam]) -> Vec<String>
Extract just the names from a list of typed params.
Sourcepub fn default_start(params: &[TypedParam]) -> Option<usize>
pub fn default_start(params: &[TypedParam]) -> Option<usize>
Return the index of the first parameter with a default value, or None.
Trait Implementations§
Source§impl Clone for TypedParam
impl Clone for TypedParam
Source§fn clone(&self) -> TypedParam
fn clone(&self) -> TypedParam
Returns a duplicate of the value. Read more
1.0.0 · 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 TypedParam
impl Debug for TypedParam
Source§impl PartialEq for TypedParam
impl PartialEq for TypedParam
impl StructuralPartialEq for TypedParam
Auto Trait Implementations§
impl Freeze for TypedParam
impl RefUnwindSafe for TypedParam
impl Send for TypedParam
impl Sync for TypedParam
impl Unpin for TypedParam
impl UnsafeUnpin for TypedParam
impl UnwindSafe for TypedParam
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