pub struct FunctionParameter {
pub pattern: DestructurePattern,
pub is_const: bool,
pub is_reference: bool,
pub is_mut_reference: bool,
pub is_out: bool,
pub type_annotation: Option<TypeAnnotation>,
pub default_value: Option<Expr>,
}Fields§
§pattern: DestructurePattern§is_const: bool§is_reference: bool§is_mut_reference: boolWhether this is an exclusive (mutable) reference: &mut x
Only meaningful when is_reference is true.
is_out: boolWhether this is an out parameter (C out-pointer pattern).
Only valid on extern C fn declarations. The compiler auto-generates
cell allocation, C call, value readback, and cell cleanup.
type_annotation: Option<TypeAnnotation>§default_value: Option<Expr>Implementations§
Source§impl FunctionParameter
impl FunctionParameter
Sourcepub fn simple_name(&self) -> Option<&str>
pub fn simple_name(&self) -> Option<&str>
Get the simple parameter name if this is a simple identifier pattern
Sourcepub fn get_identifiers(&self) -> Vec<String>
pub fn get_identifiers(&self) -> Vec<String>
Get all identifiers bound by this parameter (for destructuring patterns)
Trait Implementations§
Source§impl Clone for FunctionParameter
impl Clone for FunctionParameter
Source§fn clone(&self) -> FunctionParameter
fn clone(&self) -> FunctionParameter
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 FunctionParameter
impl Debug for FunctionParameter
Source§impl<'de> Deserialize<'de> for FunctionParameter
impl<'de> Deserialize<'de> for FunctionParameter
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
Source§impl PartialEq for FunctionParameter
impl PartialEq for FunctionParameter
Source§impl Serialize for FunctionParameter
impl Serialize for FunctionParameter
impl StructuralPartialEq for FunctionParameter
Auto Trait Implementations§
impl Freeze for FunctionParameter
impl RefUnwindSafe for FunctionParameter
impl Send for FunctionParameter
impl Sync for FunctionParameter
impl Unpin for FunctionParameter
impl UnsafeUnpin for FunctionParameter
impl UnwindSafe for FunctionParameter
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