blob: 8e0eca2349f6efa52e458fa05762a554886772ea [file] [log] [blame]
// WARNING: This file is machine generated by fidlgen.
package name
import (
_zx "syscall/zx"
_bindings "syscall/zx/fidl"
)
const (
// const comment #1
//
// const comment #3
C int32 = 4
)
// struct comment #1
//
// struct comment #3
type Struct struct {
_ struct{} `fidl2:"s,4,4"`
// struct member comment #1
//
// struct member comment #3
Field int32
}
var _mStruct = _bindings.CreateLazyMarshaler(Struct{})
func (msg *Struct) Marshaler() _bindings.Marshaler {
return _mStruct
}
// Implements Payload.
func (_ *Struct) InlineAlignment() int {
return 4
}
// Implements Payload.
func (_ *Struct) InlineSize() int {
return 4
}
type UnionTag uint32
const (
_ UnionTag = iota
UnionField
)
// union comment #1
//
// union comment #3
type Union struct {
UnionTag `fidl:"tag" fidl2:"u,8,4"`
// union member comment #1
//
// union member comment #3
Field int32
}
// Implements Payload.
func (_ *Union) InlineAlignment() int {
return 4
}
// Implements Payload.
func (_ *Union) InlineSize() int {
return 8
}
func (u *Union) Which() UnionTag {
return u.UnionTag
}
func (u *Union) SetField(field int32) {
u.UnionTag = UnionField
u.Field = field
}
// table comment #1
//
// table comment #3
type Table struct {
_ struct{} `fidl2:"t,16,8"`
// table field comment #1
//
// table field comment #3
Field int32 `fidl:"1" fidl2:"1"`
FieldPresent bool
}
// Implements Payload.
func (_ *Table) InlineAlignment() int {
return 8
}
// Implements Payload.
func (_ *Table) InlineSize() int {
return 16
}
func (u *Table) SetField(field int32) {
u.Field = field
u.FieldPresent = true
}
func (u *Table) GetField() int32 {
return u.Field
}
func (u *Table) HasField() bool {
return u.FieldPresent
}
func (u *Table) ClearField() {
u.FieldPresent = false
}
const (
InterfaceMethodOrdinal uint32 = 1061382220
InterfaceMethodGenOrdinal uint32 = 1
)
type InterfaceMethodRequest struct {
_ struct{} `fidl2:"s,0,0"`
}
var _mInterfaceMethodRequest = _bindings.CreateLazyMarshaler(InterfaceMethodRequest{})
func (msg *InterfaceMethodRequest) Marshaler() _bindings.Marshaler {
return _mInterfaceMethodRequest
}
// Implements Payload.
func (_ *InterfaceMethodRequest) InlineAlignment() int {
return 0
}
// Implements Payload.
func (_ *InterfaceMethodRequest) InlineSize() int {
return 0
}
type InterfaceInterface _bindings.ChannelProxy
// method comment #1
//
// method comment #3
func (p *InterfaceInterface) Method() error {
req_ := InterfaceMethodRequest{
}
err := ((*_bindings.ChannelProxy)(p)).Send(InterfaceMethodOrdinal, &req_)
return err
}
// interface comment #1
//
// interface comment #3
type Interface interface {
// method comment #1
//
// method comment #3
Method() error
}
type InterfaceTransitionalBase struct {}
type InterfaceInterfaceRequest _bindings.InterfaceRequest
func NewInterfaceInterfaceRequest() (InterfaceInterfaceRequest, *InterfaceInterface, error) {
req, cli, err := _bindings.NewInterfaceRequest()
return InterfaceInterfaceRequest(req), (*InterfaceInterface)(cli), err
}
type InterfaceStub struct {
Impl Interface
}
func (s *InterfaceStub) Dispatch(ord uint32, b_ []byte, h_ []_zx.Handle) (_bindings.Payload, error) {
switch ord {
case InterfaceMethodGenOrdinal:
fallthrough
case InterfaceMethodOrdinal:
in_ := InterfaceMethodRequest{}
if err_ := _bindings.Unmarshal(b_, h_, &in_); err_ != nil {
return nil, err_
}
err_ := s.Impl.Method()
return nil, err_
}
return nil, _bindings.ErrUnknownOrdinal
}
type InterfaceService struct {
_bindings.BindingSet
}
func (s *InterfaceService) Add(impl Interface, c _zx.Channel, onError func(error)) (_bindings.BindingKey, error) {
return s.BindingSet.Add(&InterfaceStub{Impl: impl}, c, onError)
}
func (s *InterfaceService) EventProxyFor(key _bindings.BindingKey) (*InterfaceEventProxy, bool) {
pxy, err := s.BindingSet.ProxyFor(key)
return (*InterfaceEventProxy)(pxy), err
}
type InterfaceEventProxy _bindings.ChannelProxy