pub struct ParamFact {
pub name: Option<Box<str>>,
pub span_start: u32,
pub kind: ParamKind,
pub optional: bool,
pub has_default: bool,
pub is_rest: bool,
pub condition_reads: u32,
pub written: bool,
pub keys: Vec<OptionKeyFact>,
}Expand description
One formal parameter of a FunctionContract.
Fields§
§name: Option<Box<str>>The parameter name. None for an object or array pattern.
span_start: u32Start byte of the parameter: the ... of a rest parameter, else the
binding or pattern.
kind: ParamKindThe binding shape of the parameter.
optional: booltrue for a TypeScript ? marker.
has_default: booltrue when the parameter has a default value.
is_rest: booltrue for a rest parameter.
condition_reads: u32The count of conditions whose test is the parameter or its negation:
the test of an if, a ?:, a loop, or p, !p and !!p there.
written: booltrue when the module writes the parameter binding: in the body, in
a default value, or in a nested function or arrow, for example
p = !p, p ??= x, [p] = xs or p++. For an object or array
pattern, true when the module writes any binding of the pattern. A
var or function declaration in the body that redeclares the
parameter also counts as a write. A written parameter can hold a
value that no caller passes.
keys: Vec<OptionKeyFact>The option keys of an object pattern, in source order. Empty for each other parameter kind, and for an object pattern whose default is not absent or an empty object literal, because such a default can set a key that no caller passes.
Trait Implementations§
impl<'__de> Decode<'__de> for ParamFactwhere
'__de:,
impl Encode for ParamFact
impl Eq for ParamFact
impl StructuralPartialEq for ParamFact
Auto Trait Implementations§
impl Forget for ParamFact
impl Freeze for ParamFact
impl Move for ParamFact
impl RefUnwindSafe for ParamFact
impl Send for ParamFact
impl Sync for ParamFact
impl Unpin for ParamFact
impl UnsafeUnpin for ParamFact
impl UnwindSafe for ParamFact
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DecodeOwned for Twhere
T: for<'de> Decode<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.