| // Code generated by fidlgen; DO NOT EDIT. |
| |
| package handlesintypes |
| |
| import ( |
| _zx "syscall/zx" |
| _bindings "syscall/zx/fidl" |
| ) |
| |
| var _ _bindings.Enum = ObjType(0) |
| |
| type ObjType uint32 |
| |
| const ( |
| ObjTypeNone ObjType = 0 |
| ObjTypeVmo ObjType = 3 |
| ) |
| |
| func (_ ObjType) I_EnumValues() []ObjType { |
| return []ObjType{ |
| ObjTypeNone, |
| ObjTypeVmo, |
| } |
| } |
| |
| func (_ ObjType) I_EnumIsStrict() bool { |
| return true |
| } |
| |
| func (x ObjType) IsUnknown() bool { |
| switch x { |
| case 0: |
| return false |
| case 3: |
| return false |
| } |
| return true |
| } |
| |
| func (x ObjType) String() string { |
| switch x { |
| case 0: |
| return "None" |
| case 3: |
| return "Vmo" |
| } |
| return "Unknown" |
| } |
| |
| type HandlesInTypes struct { |
| _ struct{} `fidl:"s" fidl_size_v2:"96" fidl_alignment_v2:"8"` |
| NormalHandle _zx.VMO `fidl_offset_v2:"0" fidl_handle_subtype:"3" fidl_handle_rights:"2147483648" fidl_bounds:"0"` |
| HandleInVec []_zx.VMO `fidl_offset_v2:"8" fidl_handle_subtype:"3" fidl_handle_rights:"2147483648" fidl_bounds:",0"` |
| HandleInArray [5]_zx.VMO `fidl_offset_v2:"24" fidl_handle_subtype:"3" fidl_handle_rights:"2147483648" fidl_bounds:"0"` |
| HandleInMixedVecArray [][5]_zx.VMO `fidl_offset_v2:"48" fidl_handle_subtype:"3" fidl_handle_rights:"2147483648" fidl_bounds:",0"` |
| TableWithHandle TableWithHandle `fidl_offset_v2:"64"` |
| UnionWithHandle UnionWithHandle `fidl_offset_v2:"80"` |
| } |
| |
| var _mHandlesInTypes = _bindings.CreateLazyMarshaler(HandlesInTypes{}) |
| |
| func (msg *HandlesInTypes) Marshaler() _bindings.Marshaler { |
| return _mHandlesInTypes |
| } |
| |
| type I_unionWithHandleTag uint64 |
| |
| const ( |
| UnionWithHandle_unknownData = 0 // 0x00000000 |
| UnionWithHandleH = 1 // 0x00000001 |
| ) |
| |
| type UnionWithHandle struct { |
| I_unionWithHandleTag `fidl:"x" fidl_size_v2:"16" fidl_alignment_v2:"8" fidl_resource:"true"` |
| I_unknownData interface{} |
| H _zx.VMO `fidl_handle_subtype:"3" fidl_handle_rights:"2147483648" fidl_bounds:"0" fidl_ordinal:"1"` |
| } |
| |
| var _mUnionWithHandle = _bindings.CreateLazyMarshaler(UnionWithHandle{}) |
| |
| func (msg *UnionWithHandle) Marshaler() _bindings.Marshaler { |
| return _mUnionWithHandle |
| } |
| |
| func (_m *UnionWithHandle) reset() { |
| switch _m.I_unionWithHandleTag { |
| case 1: |
| var _zeroed _zx.VMO |
| _m.H = _zeroed |
| default: |
| var _zeroed interface{} |
| _m.I_unknownData = _zeroed |
| } |
| } |
| |
| func (_m *UnionWithHandle) Which() I_unionWithHandleTag { |
| switch _m.I_unionWithHandleTag { |
| case 1: |
| return UnionWithHandleH |
| default: |
| return UnionWithHandle_unknownData |
| } |
| } |
| |
| func (_m *UnionWithHandle) Ordinal() uint64 { |
| return uint64(_m.I_unionWithHandleTag) |
| } |
| |
| func (_m *UnionWithHandle) SetH(h _zx.VMO) { |
| _m.reset() |
| _m.I_unionWithHandleTag = UnionWithHandleH |
| _m.H = h |
| } |
| |
| func UnionWithHandleWithH(h _zx.VMO) UnionWithHandle { |
| var _u UnionWithHandle |
| _u.SetH(h) |
| return _u |
| } |
| func (_m *UnionWithHandle) GetUnknownData() _bindings.UnknownData { |
| return _m.I_unknownData.(_bindings.UnknownData) |
| } |
| |
| type TableWithHandle struct { |
| _ struct{} `fidl:"t" fidl_size_v2:"16" fidl_alignment_v2:"8" fidl_resource:"true"` |
| I_unknownData interface{} |
| H _zx.VMO `fidl_handle_subtype:"3" fidl_handle_rights:"2147483648" fidl_bounds:"0" fidl_ordinal:"1"` |
| HPresent bool |
| } |
| |
| var _mTableWithHandle = _bindings.CreateLazyMarshaler(TableWithHandle{}) |
| |
| func (msg *TableWithHandle) Marshaler() _bindings.Marshaler { |
| return _mTableWithHandle |
| } |
| |
| func (u *TableWithHandle) SetH(h _zx.VMO) { |
| u.H = h |
| u.HPresent = true |
| } |
| |
| func (u *TableWithHandle) GetH() _zx.VMO { |
| return u.H |
| } |
| |
| func (u *TableWithHandle) GetHWithDefault(_default _zx.VMO) _zx.VMO { |
| if !u.HasH() { |
| return _default |
| } |
| return u.H |
| } |
| |
| func (u *TableWithHandle) HasH() bool { |
| return u.HPresent |
| } |
| |
| func (u *TableWithHandle) ClearH() { |
| u.HPresent = false |
| } |
| |
| func (u *TableWithHandle) HasUnknownData() bool { |
| return u.I_unknownData != nil |
| } |
| |
| func (u *TableWithHandle) GetUnknownData() map[uint64]_bindings.UnknownData { |
| return u.I_unknownData.(map[uint64]_bindings.UnknownData) |
| } |