Method in macro · Attr compiler

Attr::has

pub fn has(string key) -> bool
Import
use macro::{Attr};
Source: compiler/src/prelude/macro.hy

True when the attribute has an argument named key, or a bare key.

Called on a Attr value as value.has(…).

Parameters#

NameType
keystring

Returns#

bool

See also#

  • Attr: #[name(args)] on a declaration, field or variant.
  • Attr::src: The attribute as written: #[name(key = "v", 2)].
  • Attr::arg: Value of the key = value argument, or fallback.
↑ ↓ navigate ↵ open