pub struct Param<'arena, 'src> {Show 13 fields
pub name: Ident<'src>,
pub type_hint: Option<TypeHint<'arena, 'src>>,
pub default: Option<Expr<'arena, 'src>>,
pub by_ref: bool,
pub variadic: bool,
pub is_readonly: bool,
pub is_final: bool,
pub visibility: Option<Visibility>,
pub set_visibility: Option<Visibility>,
pub attributes: ArenaVec<'arena, Attribute<'arena, 'src>>,
pub hooks: ArenaVec<'arena, PropertyHook<'arena, 'src>>,
pub doc_comment: Option<Comment<'src>>,
pub span: Span,
}Expand description
A function, method, closure or hook parameter.
Fields§
§name: Ident<'src>Parameter name without $.
type_hint: Option<TypeHint<'arena, 'src>>Declared parameter type.
default: Option<Expr<'arena, 'src>>Default value expression.
by_ref: booltrue when by reference (&).
variadic: booltrue for a variadic parameter (...$x).
is_readonly: booltrue for a readonly promoted property.
is_final: booltrue for a final promoted property.
visibility: Option<Visibility>Visibility of a promoted constructor property.
set_visibility: Option<Visibility>Asymmetric write visibility, e.g. private(set) (PHP 8.4+).
attributes: ArenaVec<'arena, Attribute<'arena, 'src>>#[...] attributes applied to this node.
hooks: ArenaVec<'arena, PropertyHook<'arena, 'src>>Property hooks on a promoted property (PHP 8.4+).
doc_comment: Option<Comment<'src>>A doc-block attached directly to this parameter (PHP 8.6 recognizes this for reflection purposes), either immediately before it or trailing it up to the comma. Parsed at every version since a bare comment is legal PHP regardless of target version.
span: SpanSource range of this node.
Trait Implementations§
Auto Trait Implementations§
impl<'arena, 'src> !RefUnwindSafe for Param<'arena, 'src>
impl<'arena, 'src> !Send for Param<'arena, 'src>
impl<'arena, 'src> !Sync for Param<'arena, 'src>
impl<'arena, 'src> !UnwindSafe for Param<'arena, 'src>
impl<'arena, 'src> Freeze for Param<'arena, 'src>
impl<'arena, 'src> Unpin for Param<'arena, 'src>
impl<'arena, 'src> UnsafeUnpin for Param<'arena, 'src>
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