class AttributeSchema

Defined at line 58 of file ../../tools/fidl/fidlc/src/attribute_schema.h

AttributeSchema defines a schema for attributes. This includes the allowed

placement (e.g. on a method, on a struct), names and schemas for arguments,

and an optional constraint validator.

Public Members

static AttributeSchema kUserDefined

Public Methods

void AttributeSchema ()

Constructs a new schema that allows any placement, takes no arguments, and

has no constraint. Use the methods below to customize it.

Defined at line 67 of file ../../tools/fidl/fidlc/src/attribute_schema.h

AttributeSchema & RestrictTo (std::set<Element::Kind> placements)

Chainable mutators for customizing the schema.

AttributeSchema & RestrictToAnonymousLayouts ()
AttributeSchema & DisallowOnAnonymousLayouts ()
AttributeSchema & AddArg (AttributeArgSchema arg_schema)
AttributeSchema & AddArg (std::string name, AttributeArgSchema arg_schema)
AttributeSchema & Constrain (AttributeSchema::Constraint constraint)
AttributeSchema & UseEarly ()

Marks as use-early. See Kind::kUseEarly below.

AttributeSchema & CompileEarly ()

Marks as compile-early. See Kind::kCompileEarly below.

AttributeSchema & Deprecate ()

Marks as deprecated. See Kind::kDeprecated below.

bool IsCompileEarly ()

Returns true if this schema allows early compilations.

Defined at line 87 of file ../../tools/fidl/fidlc/src/attribute_schema.h

void ResolveArgs (CompileStep * step, Attribute * attribute)

Resolves constants in the attribute's arguments. In the case of an

anonymous argument like

("abc"), infers the argument's name too.

void Validate (Reporter * reporter, ExperimentalFlagSet flags, const Attribute * attribute, const Element * element)

Validates the attribute's placement and constraints. Must call

`ResolveArgs` first.

AttributeSchemaMap OfficialAttributes ()

Returns attribute schemas for FIDL's officially recognized attributes.