Documentation
¶
Index ¶
- Constants
- func ConstNameToAllCapsSnake(name string) string
- func ConstNameToKCamelCase(name string) string
- func PrintableASCII(s string) bool
- func PrintableASCIIRune(r rune) bool
- func RemoveLeadingK(name string) string
- func SingleQuote(s string) string
- func TemplateFatalf(format string, a ...interface{})
- func ToFriendlyCase(name string) string
- func ToLowerCamelCase(name string) string
- func ToSnakeCase(name string) string
- func ToUpperCamelCase(name string) string
- func WriteFileIfChanged(filename string, contents []byte) error
- type Attribute
- type AttributeArg
- type Attributes
- type Bits
- type BitsMember
- type CompoundIdentifier
- type Const
- type Constant
- type ConstantKind
- type Decl
- type DeclInfo
- type DeclInfoMap
- type DeclMap
- type DeclType
- type Declaration
- type EncodedCompoundIdentifier
- type EncodedLibraryIdentifier
- type Enum
- type EnumMember
- type FieldShape
- type Formatter
- type Generator
- type HandleRights
- type HandleSubtype
- type Identifier
- type Layout
- type Library
- type LibraryIdentifier
- type LibraryName
- type Literal
- type LiteralKind
- type Method
- type Name
- type NameContext
- type ObjectType
- type PrimitiveSubtype
- type Protocol
- type Resourceness
- type Root
- type Service
- type ServiceMember
- type Strictness
- type Struct
- type StructMember
- type Table
- type TableMember
- type Type
- type TypeKind
- type TypeShape
- type Union
- type UnionMember
Constants ¶
const ( ObjectTypeNone = ObjectType(iota) ObjectTypeProcess ObjectTypeThread ObjectTypeVmo ObjectTypeChannel ObjectTypeEvent ObjectTypePort ObjectTypeInterrupt ObjectTypePciDevice ObjectTypeLog ObjectTypeSocket ObjectTypeResource ObjectTypeEventPair ObjectTypeJob ObjectTypeVmar ObjectTypeFifo ObjectTypeGuest ObjectTypeVcpu ObjectTypeTimer ObjectTypeIommu ObjectTypeBti ObjectTypeProfile ObjectTypePmt ObjectTypeSuspendToken ObjectTypePager ObjectTypeException ObjectTypeClock )
Variables ¶
This section is empty.
Functions ¶
func ConstNameToAllCapsSnake ¶
Convert a const name from kCamelCase to ALL_CAPS_SNAKE style
func ConstNameToKCamelCase ¶
Convert a const name to kCamelCase style
func PrintableASCII ¶
PrintableASCII reports whether s is made of only printable ASCII runes.
func PrintableASCIIRune ¶
PrintableASCIIRune reports whether r is a printable ASCII rune, i.e. in the range 0x20 to 0x7E.
func RemoveLeadingK ¶
Removes a leading 'k' if the second character is upper-case, otherwise returns the argument
func SingleQuote ¶
func TemplateFatalf ¶
func TemplateFatalf(format string, a ...interface{})
TemplateFatalf exits the program with a formatted error message similar to Printf. It is meant to be used by helper functions invoked by the template engine, since normal panics are swallowed by it.
func ToFriendlyCase ¶
Convert text to friendly case style (like snake case, but with spaces)
func ToLowerCamelCase ¶
Convert a name to lowerCamelCase style
func ToUpperCamelCase ¶
Convert a name to UpperCamelCase style
func WriteFileIfChanged ¶
WriteFileIfChanged overwrite the filename with new contents unless the file already has those contents.
Types ¶
type Attribute ¶
type Attribute struct { Name Identifier `json:"name"` Args []AttributeArg `json:"arguments,omitempty"` }
func (Attribute) HasArg ¶
func (el Attribute) HasArg(name Identifier) bool
func (Attribute) LookupArg ¶
func (el Attribute) LookupArg(name Identifier) (AttributeArg, bool)
func (Attribute) LookupArgStandalone ¶
func (el Attribute) LookupArgStandalone() (AttributeArg, bool)
type AttributeArg ¶
type AttributeArg struct { Name Identifier `json:"name"` Value Constant `json:"value"` }
func (AttributeArg) ValueString ¶
func (el AttributeArg) ValueString() string
ValueString returns the attribute arg's value in string form. TODO(fxbug.dev/81390): Attribute values may only be string literals for now.
Make sure to fix this API once that changes to resolve the constant value for all constant types.
type Attributes ¶
type Attributes struct {
Attributes []Attribute `json:"maybe_attributes,omitempty"`
}
Attributes represents a list of attributes. It conveniently implements the `Annotated` protocol, such that it can be embedded into other node structs which are annotated.
func (Attributes) BindingsDenylistIncludes ¶
func (el Attributes) BindingsDenylistIncludes(targetLanguage string) bool
BindingsDenylistIncludes returns true if the comma-separated bindings_denylist attribute includes targetLanguage (meaning the bindings for targetLanguage should not emit this declaration).
func (Attributes) DocComments ¶
func (el Attributes) DocComments() []string
func (Attributes) HasAttribute ¶
func (el Attributes) HasAttribute(name Identifier) bool
func (Attributes) LookupAttribute ¶
func (el Attributes) LookupAttribute(name Identifier) (Attribute, bool)
func (Attributes) Transports ¶
func (el Attributes) Transports() map[string]struct{}
type Bits ¶
type Bits struct { Layout Type Type `json:"type"` Mask string `json:"mask"` Members []BitsMember `json:"members"` Strictness `json:"strict"` }
Bits represents a FIDL declaration of an bits.
type BitsMember ¶
type BitsMember struct { Attributes Name Identifier `json:"name"` Value Constant `json:"value"` }
BitsMember represents a single variant in a FIDL bits.
type CompoundIdentifier ¶
type CompoundIdentifier struct { Library LibraryIdentifier Name Identifier Member Identifier }
func ParseCompoundIdentifier ¶
func ParseCompoundIdentifier(eci EncodedCompoundIdentifier) CompoundIdentifier
func (CompoundIdentifier) Encode ¶
func (ci CompoundIdentifier) Encode() EncodedCompoundIdentifier
func (CompoundIdentifier) EncodeDecl ¶
func (ci CompoundIdentifier) EncodeDecl() EncodedCompoundIdentifier
type Constant ¶
type Constant struct { Kind ConstantKind `json:"kind"` Identifier EncodedCompoundIdentifier `json:"identifier,omitempty"` Literal Literal `json:"literal,omitempty"` Value string `json:"value"` }
type ConstantKind ¶
type ConstantKind string
const ( IdentifierConstant ConstantKind = "identifier" LiteralConstant ConstantKind = "literal" BinaryOperator ConstantKind = "binary_operator" )
type Decl ¶
type Decl struct { Attributes Name EncodedCompoundIdentifier `json:"name"` }
func (*Decl) GetName ¶
func (d *Decl) GetName() EncodedCompoundIdentifier
type DeclInfo ¶
type DeclInfo struct { Type DeclType `json:"kind"` // Present for structs, tables, and unions. *Resourceness `json:"resource,omitempty"` }
type DeclInfoMap ¶
type DeclInfoMap map[EncodedCompoundIdentifier]DeclInfo
type DeclMap ¶
type DeclMap map[EncodedCompoundIdentifier]DeclType
type DeclType ¶
type DeclType string
const ( LibraryDeclType DeclType = "library" ConstDeclType DeclType = "const" BitsDeclType DeclType = "bits" EnumDeclType DeclType = "enum" ProtocolDeclType DeclType = "interface" ServiceDeclType DeclType = "service" StructDeclType DeclType = "struct" TableDeclType DeclType = "table" UnionDeclType DeclType = "union" )
func (DeclType) IsPrimitive ¶
type Declaration ¶
type Declaration interface {
GetName() EncodedCompoundIdentifier
}
type EncodedCompoundIdentifier ¶
type EncodedCompoundIdentifier string
func EnsureLibrary ¶
func EnsureLibrary(l EncodedLibraryIdentifier, eci EncodedCompoundIdentifier) EncodedCompoundIdentifier
func (EncodedCompoundIdentifier) DeclName ¶
func (eci EncodedCompoundIdentifier) DeclName() EncodedCompoundIdentifier
func (EncodedCompoundIdentifier) LibraryName ¶
func (eci EncodedCompoundIdentifier) LibraryName() EncodedLibraryIdentifier
func (EncodedCompoundIdentifier) Parts ¶
func (eci EncodedCompoundIdentifier) Parts() CompoundIdentifier
type EncodedLibraryIdentifier ¶
type EncodedLibraryIdentifier string
func (EncodedLibraryIdentifier) Parts ¶
func (eli EncodedLibraryIdentifier) Parts() LibraryIdentifier
func (EncodedLibraryIdentifier) PartsReversed ¶
func (eli EncodedLibraryIdentifier) PartsReversed() []string
type Enum ¶
type Enum struct { Layout Type PrimitiveSubtype `json:"type"` Members []EnumMember `json:"members"` Strictness `json:"strict"` RawUnknownValue int64OrUint64 `json:"maybe_unknown_value"` }
Enum represents a FIDL declaration of an enum.
func (*Enum) UnknownValueAsInt64 ¶
UnknownValueAsInt64 retrieves the unknown value. Succeeds only for signed flexible enums.
func (*Enum) UnknownValueAsUint64 ¶
UnknownValueAsUint64 retrieves the unknown value. Succeeds only for unsigned flexible enums.
func (*Enum) UnknownValueForTmpl ¶
func (enum *Enum) UnknownValueForTmpl() interface{}
UnknownValueForTmpl retrieves the signed or unsigned unknown value. Panics if called on a strict enum.
type EnumMember ¶
type EnumMember struct { Attributes Name Identifier `json:"name"` Value Constant `json:"value"` }
EnumMember represents a single variant in a FIDL enum.
func (*EnumMember) IsUnknown ¶
func (member *EnumMember) IsUnknown() bool
IsUnknown indicates whether this member represents a custom unknown flexible enum member.
type FieldShape ¶
FieldShape represents the shape of the field on the wire. See JSON IR schema, e.g. fidlc --json-schema
type Formatter ¶
Formatter formats generated source code
func NewFormatter ¶
NewFormatter creates a new external formatter.
The `path` needs to either * Point to an executable which formats stdin and outputs it to stdout; * An empty string, in which case no formatting will occur.
func NewFormatterWithSizeLimit ¶
NewFormatterWithSizeLimit creates a new external formatter that doesn't attempt to format sources over a specified size.
The `path` needs to either * Point to an executable which formats stdin and outputs it to stdout; * An empty string, in which case no formatting will occur.
type Generator ¶
type Generator struct {
// contains filtered or unexported fields
}
func NewGenerator ¶
func (*Generator) ExecuteTemplate ¶
type HandleRights ¶
type HandleRights uint32
const ( HandleRightsNone HandleRights = 0 HandleRightsDuplicate HandleRights = 1 << 0 HandleRightsTransfer HandleRights = 1 << 1 HandleRightsRead HandleRights = 1 << 2 HandleRightsWrite HandleRights = 1 << 3 HandleRightsExecute HandleRights = 1 << 4 HandleRightsMap HandleRights = 1 << 5 HandleRightsGetProperty HandleRights = 1 << 6 HandleRightsSetProperty HandleRights = 1 << 7 HandleRightsEnumerate HandleRights = 1 << 8 HandleRightsDestroy HandleRights = 1 << 9 HandleRightsSetPolicy HandleRights = 1 << 10 HandleRightsGetPolicy HandleRights = 1 << 11 HandleRightsSignal HandleRights = 1 << 12 HandleRightsSignalPeer HandleRights = 1 << 13 HandleRightsWait HandleRights = 1 << 14 HandleRightsInspect HandleRights = 1 << 15 HandleRightsManageJob HandleRights = 1 << 16 HandleRightsManageProcess HandleRights = 1 << 17 HandleRightsManageThread HandleRights = 1 << 18 HandleRightsApplyProfile HandleRights = 1 << 19 HandleRightsSameRights HandleRights = 1 << 31 HandleRightsBasic HandleRights = HandleRightsTransfer | HandleRightsDuplicate | HandleRightsWait | HandleRightsInspect )
type HandleSubtype ¶
type HandleSubtype string
const ( Handle HandleSubtype = "handle" Bti HandleSubtype = "bti" Channel HandleSubtype = "channel" Clock HandleSubtype = "clock" DebugLog HandleSubtype = "debuglog" Event HandleSubtype = "event" Eventpair HandleSubtype = "eventpair" Exception HandleSubtype = "exception" Fifo HandleSubtype = "fifo" Guest HandleSubtype = "guest" Interrupt HandleSubtype = "interrupt" Iommu HandleSubtype = "iommu" Job HandleSubtype = "job" Pager HandleSubtype = "pager" PciDevice HandleSubtype = "pcidevice" Pmt HandleSubtype = "pmt" Port HandleSubtype = "port" Process HandleSubtype = "process" Profile HandleSubtype = "profile" Resource HandleSubtype = "resource" Socket HandleSubtype = "socket" Stream HandleSubtype = "stream" SuspendToken HandleSubtype = "suspendtoken" Thread HandleSubtype = "thread" Time HandleSubtype = "timer" Vcpu HandleSubtype = "vcpu" Vmar HandleSubtype = "vmar" Vmo HandleSubtype = "vmo" )
type Identifier ¶
type Identifier string
type Layout ¶
Layout represents data specific to bits/enums/structs/tables/unions. All layouts are decls, but not all decls are layouts (e.g. protocols).
func (*Layout) IsAnonymous ¶
type Library ¶
type Library struct { Name EncodedLibraryIdentifier `json:"name,omitempty"` Decls DeclInfoMap `json:"declarations,omitempty"` }
Library represents a FIDL dependency on a separate library.
type LibraryIdentifier ¶
type LibraryIdentifier []Identifier
func ParseLibraryName ¶
func ParseLibraryName(eli EncodedLibraryIdentifier) LibraryIdentifier
func (LibraryIdentifier) Encode ¶
func (li LibraryIdentifier) Encode() EncodedLibraryIdentifier
type LibraryName ¶
type LibraryName struct {
// contains filtered or unexported fields
}
LibraryName represents a FIDL library name, such as `fuchsia.mem` or `fuchsia.ui.scenic`.
func MustReadLibraryName ¶
func MustReadLibraryName(fullyQualifiedName string) LibraryName
MustReadLibraryName reads a library name from a fully qualified name, and panics in case of error.
func ReadLibraryName ¶
func ReadLibraryName(fullyQualifiedName string) (LibraryName, error)
ReadLibraryName reads a library name from a fully qualified name.
func (LibraryName) FullyQualifiedName ¶
func (name LibraryName) FullyQualifiedName() string
FullyQualifiedName returns the fully qualified name, e.g. `fuchsia.mem` or `fuchsia.ui.scenic`.
func (LibraryName) Parts ¶
func (name LibraryName) Parts() []string
Parts returns the library name in parts, e.g. `fuchsia`, `mem` or `fuchsia`, `ui`, `scenic`.
func (LibraryName) String ¶
func (name LibraryName) String() string
type Literal ¶
type Literal struct { Kind LiteralKind `json:"kind"` Value string `json:"value,omitempty"` }
type LiteralKind ¶
type LiteralKind string
const ( StringLiteral LiteralKind = "string" NumericLiteral LiteralKind = "numeric" BoolLiteral LiteralKind = "bool" DefaultLiteral LiteralKind = "default" )
type Method ¶
type Method struct { Attributes Ordinal uint64 `json:"ordinal"` Name Identifier `json:"name"` IsComposed bool `json:"is_composed"` HasRequest bool `json:"has_request"` RequestPayload *Type `json:"maybe_request_payload,omitempty"` RequestPadding bool `json:"maybe_request_has_padding,omitempty"` RequestFlexible bool `json:"experimental_maybe_request_has_flexible_envelope,omitempty"` HasResponse bool `json:"has_response"` ResponsePayload *Type `json:"maybe_response_payload,omitempty"` HasError bool `json:"has_error"` ResultType *Type `json:"maybe_response_result_type,omitempty"` ValueType *Type `json:"maybe_response_success_type,omitempty"` ValueStruct *Struct `json:"maybe_response_success_struct,omitempty"` ErrorType *Type `json:"maybe_response_err_type,omitempty"` }
Method represents the declaration of a FIDL method.
func (*Method) GetRequestPayloadIdentifier ¶
func (m *Method) GetRequestPayloadIdentifier() (EncodedCompoundIdentifier, bool)
GetRequestPayloadIdentifier retrieves the identifier that points to the declaration of the request payload.
func (*Method) GetResponsePayloadIdentifier ¶
func (m *Method) GetResponsePayloadIdentifier() (EncodedCompoundIdentifier, bool)
GetResponsePayloadIdentifier retrieves the identifier that points to the declaration of the response payload.
func (*Method) IsTransitional ¶
IsTransitional returns whether this method has the `Transitional` attribute.
type Name ¶
type Name struct {
// contains filtered or unexported fields
}
Name represents a FIDL declaration name, consisting of a FIDL library, and a FIDL declration such as `fuchsia.mem` and `Buffer`.
func MustReadName ¶
MustReadName reads a name from a fully qualified name, and panics in case of error.
func (Name) DeclarationName ¶
DeclarationName returns the declaration name, e.g. `Buffer`.
func (Name) FullyQualifiedName ¶
FullyQualifiedName returns the fully qualified name, e.g. `fuchsia.mem/Buffer`.
func (Name) LibraryName ¶
func (name Name) LibraryName() LibraryName
LibraryName returns the library name, e.g. `fuchsia.mem`.
type NameContext ¶
type NameContext struct {
// contains filtered or unexported fields
}
func NewNameContext ¶
func NewNameContext() NameContext
func (NameContext) IsReserved ¶
func (nc NameContext) IsReserved(name string) bool
func (NameContext) ReserveNames ¶
func (nc NameContext) ReserveNames(names []string)
type ObjectType ¶
type ObjectType uint32
TODO(fxb/64629): Remove, source of truth is library zx.
One complication is that GIDL parses nice handle subtypes in its grammar, e.g. `#0 = event(rights: execute + write )`. And some GIDL backends care about the object type. This means that we need to duplicate this mapping :/ It would be cleaner to limit this to GIDL and GIDL backends, rather than offer that in the general purpose lib/fidlgen.
func ObjectTypeFromHandleSubtype ¶
func ObjectTypeFromHandleSubtype(val HandleSubtype) ObjectType
type PrimitiveSubtype ¶
type PrimitiveSubtype string
const ( Bool PrimitiveSubtype = "bool" Int8 PrimitiveSubtype = "int8" Int16 PrimitiveSubtype = "int16" Int32 PrimitiveSubtype = "int32" Int64 PrimitiveSubtype = "int64" Uint8 PrimitiveSubtype = "uint8" Uint16 PrimitiveSubtype = "uint16" Uint32 PrimitiveSubtype = "uint32" Uint64 PrimitiveSubtype = "uint64" Float32 PrimitiveSubtype = "float32" Float64 PrimitiveSubtype = "float64" )
func (PrimitiveSubtype) IsSigned ¶
func (typ PrimitiveSubtype) IsSigned() bool
IsSigned indicates whether this subtype represents a signed number such as `int16`, or `float32`.
func (PrimitiveSubtype) IsUnsigned ¶
func (typ PrimitiveSubtype) IsUnsigned() bool
IsUnsigned indicates whether this subtype represents an unsigned number such as `uint16`.
type Protocol ¶
Protocol represents the declaration of a FIDL protocol.
func (*Protocol) GetServiceName ¶
type Resourceness ¶
type Resourceness bool
Resourceness represents whether a FIDL object may contain any resource types, such as handles. See https://fuchsia.dev/fuchsia-src/contribute/governance/fidl/ftp/ftp-057 for more information.
const ( IsResourceType Resourceness = true IsValueType Resourceness = false )
func (Resourceness) IsResourceType ¶
func (r Resourceness) IsResourceType() bool
IsResourceType indicates whether this type is marked as a resource type
func (Resourceness) IsValueType ¶
func (r Resourceness) IsValueType() bool
IsValueType indicates whether this type is not marked as a resource type
type Root ¶
type Root struct { Name EncodedLibraryIdentifier `json:"name,omitempty"` Consts []Const `json:"const_declarations,omitempty"` Bits []Bits `json:"bits_declarations,omitempty"` Enums []Enum `json:"enum_declarations,omitempty"` Protocols []Protocol `json:"interface_declarations,omitempty"` Services []Service `json:"service_declarations,omitempty"` Structs []Struct `json:"struct_declarations,omitempty"` Tables []Table `json:"table_declarations,omitempty"` Unions []Union `json:"union_declarations,omitempty"` DeclOrder []EncodedCompoundIdentifier `json:"declaration_order,omitempty"` Decls DeclMap `json:"declarations,omitempty"` Libraries []Library `json:"library_dependencies,omitempty"` // contains filtered or unexported fields }
Root is the top-level object for a FIDL library. It contains lists of all declarations and dependencies within the library.
func DecodeJSONIr ¶
DecodeJSONIr reads the JSON content from a reader.
func ReadJSONIrContent ¶
ReadJSONIrContent reads JSON IR content.
func (*Root) DeclsWithDependencies ¶
func (r *Root) DeclsWithDependencies() DeclInfoMap
DeclsWithDependencies returns a single DeclInfoMap containing the FIDL library's declarations and those of its dependencies.
func (*Root) ForBindings ¶
ForBindings filters out declarations that should be omitted in the given language bindings based on BindingsDenylist attributes. It returns a new Root and does not modify r.
func (*Root) LookupDecl ¶
func (r *Root) LookupDecl(i EncodedCompoundIdentifier) Declaration
type Service ¶
type Service struct { Decl Members []ServiceMember `json:"members"` }
Service represents the declaration of a FIDL service.
func (*Service) GetServiceName ¶
type ServiceMember ¶
type ServiceMember struct { Attributes Name Identifier `json:"name"` Type Type `json:"type"` }
ServiceMember represents the declaration of a field in a FIDL service.
type Strictness ¶
type Strictness bool
Strictness represents whether a FIDL object is strict or flexible. See <https://fuchsia.dev/fuchsia-src/development/languages/fidl/reference/ftp/ftp-033> for more information.
const ( IsFlexible Strictness = false IsStrict Strictness = true )
func (Strictness) IsFlexible ¶
func (s Strictness) IsFlexible() bool
IsFlexible indicates whether this type is flexible.
func (Strictness) IsStrict ¶
func (s Strictness) IsStrict() bool
IsStrict indicates whether this type is strict.
type Struct ¶
type Struct struct { Layout IsRequestOrResponse bool `json:"is_request_or_response"` Members []StructMember `json:"members"` Resourceness `json:"resource"` TypeShapeV1 TypeShape `json:"type_shape_v1"` TypeShapeV2 TypeShape `json:"type_shape_v2"` }
Struct represents a declaration of a FIDL struct.
type StructMember ¶
type StructMember struct { Attributes Type Type `json:"type"` Name Identifier `json:"name"` MaybeDefaultValue *Constant `json:"maybe_default_value,omitempty"` MaxHandles int `json:"max_handles"` FieldShapeV1 FieldShape `json:"field_shape_v1"` FieldShapeV2 FieldShape `json:"field_shape_v2"` }
StructMember represents the declaration of a field in a FIDL struct.
func EmptyStructMember ¶
func EmptyStructMember(name string) StructMember
EmptyStructMember returns a StructMember that's suitable as the sole member of an empty struct.
type Table ¶
type Table struct { Layout Members []TableMember `json:"members"` Resourceness `json:"resource"` TypeShapeV1 TypeShape `json:"type_shape_v1"` TypeShapeV2 TypeShape `json:"type_shape_v2"` }
Table represents a declaration of a FIDL table.
func (*Table) SortedMembersNoReserved ¶
func (t *Table) SortedMembersNoReserved() []TableMember
SortedMembersNoReserved returns the table's members sorted by ordinal, excluding reserved members.
type TableMember ¶
type TableMember struct { Attributes Reserved bool `json:"reserved"` Type Type `json:"type"` Name Identifier `json:"name"` Ordinal int `json:"ordinal"` MaybeDefaultValue *Constant `json:"maybe_default_value,omitempty"` MaxOutOfLine int `json:"max_out_of_line"` }
TableMember represents the declaration of a field in a FIDL table.
type Type ¶
type Type struct { Kind TypeKind ElementType *Type ElementCount *int HandleSubtype HandleSubtype HandleRights HandleRights RequestSubtype EncodedCompoundIdentifier PrimitiveSubtype PrimitiveSubtype Identifier EncodedCompoundIdentifier Nullable bool ObjType uint32 TypeShapeV1 TypeShape TypeShapeV2 TypeShape }
func (*Type) UnmarshalJSON ¶
UnmarshalJSON customizes the JSON unmarshalling for Type.
type TypeShape ¶
type TypeShape struct { InlineSize int `json:"inline_size"` Alignment int `json:"alignment"` Depth int `json:"depth"` MaxHandles int `json:"max_handles"` MaxOutOfLine int `json:"max_out_of_line"` HasPadding bool `json:"has_padding"` HasFlexibleEnvelope bool `json:"has_flexible_envelope"` }
TypeShape represents the shape of the type on the wire. See JSON IR schema, e.g. fidlc --json-schema
type Union ¶
type Union struct { Layout Members []UnionMember `json:"members"` Strictness `json:"strict"` Resourceness `json:"resource"` TypeShapeV1 TypeShape `json:"type_shape_v1"` TypeShapeV2 TypeShape `json:"type_shape_v2"` }
Union represents the declaration of a FIDL union.
type UnionMember ¶
type UnionMember struct { Attributes Reserved bool `json:"reserved"` Ordinal int `json:"ordinal"` Type Type `json:"type"` Name Identifier `json:"name"` Offset int `json:"offset"` MaxOutOfLine int `json:"max_out_of_line"` }
UnionMember represents the declaration of a field in a FIDL extensible union.