| // Code generated by fidlgen; DO NOT EDIT. |
| |
| package anonymous |
| |
| import ( |
| _strings "strings" |
| _bindings "syscall/zx/fidl" |
| ) |
| |
| var _ _bindings.Enum = Op(0) |
| |
| type Op uint32 |
| |
| const ( |
| OpAdd Op = 1 |
| OpMul Op = 2 |
| OpDiv Op = 3 |
| |
| // Op_Unknown is the default unknown placeholder. |
| Op_Unknown Op = 0xffffffff |
| ) |
| |
| func (_ Op) I_EnumValues() []Op { |
| return []Op{ |
| OpAdd, |
| OpMul, |
| OpDiv, |
| } |
| } |
| |
| func (_ Op) I_EnumIsStrict() bool { |
| return false |
| } |
| |
| func (x Op) IsUnknown() bool { |
| switch x { |
| case 1: |
| return false |
| case 2: |
| return false |
| case 3: |
| return false |
| } |
| return true |
| } |
| |
| func (x Op) String() string { |
| switch x { |
| case 1: |
| return "Add" |
| case 2: |
| return "Mul" |
| case 3: |
| return "Div" |
| } |
| return "Unknown" |
| } |
| |
| var _ _bindings.Enum = SomeProtocolSomeMethodError(0) |
| |
| type SomeProtocolSomeMethodError uint32 |
| |
| const ( |
| SomeProtocolSomeMethodErrorErrorOne SomeProtocolSomeMethodError = 1 |
| SomeProtocolSomeMethodErrorErrorTwo SomeProtocolSomeMethodError = 2 |
| |
| // SomeProtocolSomeMethodError_Unknown is the default unknown placeholder. |
| SomeProtocolSomeMethodError_Unknown SomeProtocolSomeMethodError = 0xffffffff |
| ) |
| |
| func (_ SomeProtocolSomeMethodError) I_EnumValues() []SomeProtocolSomeMethodError { |
| return []SomeProtocolSomeMethodError{ |
| SomeProtocolSomeMethodErrorErrorOne, |
| SomeProtocolSomeMethodErrorErrorTwo, |
| } |
| } |
| |
| func (_ SomeProtocolSomeMethodError) I_EnumIsStrict() bool { |
| return false |
| } |
| |
| func (x SomeProtocolSomeMethodError) IsUnknown() bool { |
| switch x { |
| case 1: |
| return false |
| case 2: |
| return false |
| } |
| return true |
| } |
| |
| func (x SomeProtocolSomeMethodError) String() string { |
| switch x { |
| case 1: |
| return "ErrorOne" |
| case 2: |
| return "ErrorTwo" |
| } |
| return "Unknown" |
| } |
| |
| var _ _bindings.Bits = BitsMember(0) |
| |
| type BitsMember uint32 |
| |
| const ( |
| BitsMemberBitOne BitsMember = 1 |
| BitsMemberBitTwo BitsMember = 2 |
| BitsMember_Mask BitsMember = 3 |
| ) |
| |
| func (_ BitsMember) I_BitsMask() BitsMember { |
| return BitsMember_Mask |
| } |
| |
| func (_ BitsMember) I_BitsIsStrict() bool { |
| return false |
| } |
| |
| func (x BitsMember) HasUnknownBits() bool { |
| return x.GetUnknownBits() != 0 |
| } |
| |
| func (x BitsMember) GetUnknownBits() uint64 { |
| return uint64(^BitsMember_Mask & x) |
| } |
| |
| func (x BitsMember) InvertBits() BitsMember { |
| return BitsMember_Mask & ^x |
| } |
| |
| // HasBits validates that all flipped bits in the mask are set. |
| func (x BitsMember) HasBits(mask BitsMember) bool { |
| return mask|x == x |
| } |
| |
| // ClearBits ensures all flipped bits in the mask are unset. |
| func (x BitsMember) ClearBits(mask BitsMember) BitsMember { |
| return ^mask & x |
| } |
| |
| func (x BitsMember) String() string { |
| var buf _strings.Builder |
| if 1&x != 0 { |
| if buf.Len() != 0 { |
| buf.WriteRune('|') |
| } |
| buf.WriteString("BitOne") |
| } |
| if 2&x != 0 { |
| if buf.Len() != 0 { |
| buf.WriteRune('|') |
| } |
| buf.WriteString("BitTwo") |
| } |
| if buf.Len() == 0 { |
| buf.WriteString("<empty bits>") |
| } |
| return buf.String() |
| } |
| |
| var _ _bindings.Bits = Flags(0) |
| |
| type Flags uint16 |
| |
| const ( |
| FlagsInline Flags = 1 |
| Flags_Mask Flags = 1 |
| ) |
| |
| func (_ Flags) I_BitsMask() Flags { |
| return Flags_Mask |
| } |
| |
| func (_ Flags) I_BitsIsStrict() bool { |
| return false |
| } |
| |
| func (x Flags) HasUnknownBits() bool { |
| return x.GetUnknownBits() != 0 |
| } |
| |
| func (x Flags) GetUnknownBits() uint64 { |
| return uint64(^Flags_Mask & x) |
| } |
| |
| func (x Flags) InvertBits() Flags { |
| return Flags_Mask & ^x |
| } |
| |
| // HasBits validates that all flipped bits in the mask are set. |
| func (x Flags) HasBits(mask Flags) bool { |
| return mask|x == x |
| } |
| |
| // ClearBits ensures all flipped bits in the mask are unset. |
| func (x Flags) ClearBits(mask Flags) Flags { |
| return ^mask & x |
| } |
| |
| func (x Flags) String() string { |
| var buf _strings.Builder |
| if 1&x != 0 { |
| if buf.Len() != 0 { |
| buf.WriteRune('|') |
| } |
| buf.WriteString("Inline") |
| } |
| if buf.Len() == 0 { |
| buf.WriteString("<empty bits>") |
| } |
| return buf.String() |
| } |
| |
| type OverrideTest struct { |
| _ struct{} `fidl:"s" fidl_size_v2:"40" fidl_alignment_v2:"8"` |
| Op Op `fidl_offset_v2:"0"` |
| Left *Expression `fidl_offset_v2:"8"` |
| Right *Expression `fidl_offset_v2:"24"` |
| } |
| |
| var _mOverrideTest = _bindings.CreateLazyMarshaler(OverrideTest{}) |
| |
| func (msg *OverrideTest) Marshaler() _bindings.Marshaler { |
| return _mOverrideTest |
| } |
| |
| type SomeProtocolSomeMethodResponse struct { |
| _ struct{} `fidl:"s" fidl_size_v2:"4" fidl_alignment_v2:"4"` |
| BitsMember BitsMember `fidl_offset_v2:"0"` |
| } |
| |
| var _mSomeProtocolSomeMethodResponse = _bindings.CreateLazyMarshaler(SomeProtocolSomeMethodResponse{}) |
| |
| func (msg *SomeProtocolSomeMethodResponse) Marshaler() _bindings.Marshaler { |
| return _mSomeProtocolSomeMethodResponse |
| } |
| |
| type TableData struct { |
| _ struct{} `fidl:"s" fidl_size_v2:"1" fidl_alignment_v2:"1"` |
| Data uint8 `fidl_offset_v2:"0"` |
| } |
| |
| var _mTableData = _bindings.CreateLazyMarshaler(TableData{}) |
| |
| func (msg *TableData) Marshaler() _bindings.Marshaler { |
| return _mTableData |
| } |
| |
| type someProtocolWithCtxSomeMethodRequest struct { |
| _ struct{} `fidl:"s" fidl_size_v2:"32" fidl_alignment_v2:"8"` |
| UnionMember UnionMember `fidl_offset_v2:"0"` |
| TableMember TableMember `fidl_offset_v2:"16"` |
| } |
| |
| var _msomeProtocolWithCtxSomeMethodRequest = _bindings.CreateLazyMarshaler(someProtocolWithCtxSomeMethodRequest{}) |
| |
| func (msg *someProtocolWithCtxSomeMethodRequest) Marshaler() _bindings.Marshaler { |
| return _msomeProtocolWithCtxSomeMethodRequest |
| } |
| |
| type someProtocolWithCtxSomeMethodResponse struct { |
| _ struct{} `fidl:"s" fidl_size_v2:"16" fidl_alignment_v2:"8"` |
| Result SomeProtocolSomeMethodResult `fidl_offset_v2:"0"` |
| } |
| |
| var _msomeProtocolWithCtxSomeMethodResponse = _bindings.CreateLazyMarshaler(someProtocolWithCtxSomeMethodResponse{}) |
| |
| func (msg *someProtocolWithCtxSomeMethodResponse) Marshaler() _bindings.Marshaler { |
| return _msomeProtocolWithCtxSomeMethodResponse |
| } |
| |
| type I_expressionTag uint64 |
| |
| const ( |
| Expression_unknownData = 0 // 0x00000000 |
| ExpressionValue = 1 // 0x00000001 |
| ExpressionBinOp = 2 // 0x00000002 |
| ExpressionFunctionApplication = 3 // 0x00000003 |
| ) |
| |
| type Expression struct { |
| I_expressionTag `fidl:"x" fidl_size_v2:"16" fidl_alignment_v2:"8" fidl_resource:"false"` |
| I_unknownData interface{} |
| Value uint64 `fidl_ordinal:"1"` |
| BinOp OverrideTest `fidl_ordinal:"2"` |
| FunctionApplication FunctionApplication `fidl_ordinal:"3"` |
| } |
| |
| var _mExpression = _bindings.CreateLazyMarshaler(Expression{}) |
| |
| func (msg *Expression) Marshaler() _bindings.Marshaler { |
| return _mExpression |
| } |
| |
| func (_m *Expression) reset() { |
| switch _m.I_expressionTag { |
| case 1: |
| var _zeroed uint64 |
| _m.Value = _zeroed |
| case 2: |
| var _zeroed OverrideTest |
| _m.BinOp = _zeroed |
| case 3: |
| var _zeroed FunctionApplication |
| _m.FunctionApplication = _zeroed |
| default: |
| var _zeroed interface{} |
| _m.I_unknownData = _zeroed |
| } |
| } |
| |
| func (_m *Expression) Which() I_expressionTag { |
| switch _m.I_expressionTag { |
| case 1: |
| return ExpressionValue |
| case 2: |
| return ExpressionBinOp |
| case 3: |
| return ExpressionFunctionApplication |
| default: |
| return Expression_unknownData |
| } |
| } |
| |
| func (_m *Expression) Ordinal() uint64 { |
| return uint64(_m.I_expressionTag) |
| } |
| |
| func (_m *Expression) SetValue(value uint64) { |
| _m.reset() |
| _m.I_expressionTag = ExpressionValue |
| _m.Value = value |
| } |
| |
| func ExpressionWithValue(value uint64) Expression { |
| var _u Expression |
| _u.SetValue(value) |
| return _u |
| } |
| |
| func (_m *Expression) SetBinOp(binOp OverrideTest) { |
| _m.reset() |
| _m.I_expressionTag = ExpressionBinOp |
| _m.BinOp = binOp |
| } |
| |
| func ExpressionWithBinOp(binOp OverrideTest) Expression { |
| var _u Expression |
| _u.SetBinOp(binOp) |
| return _u |
| } |
| |
| func (_m *Expression) SetFunctionApplication(functionApplication FunctionApplication) { |
| _m.reset() |
| _m.I_expressionTag = ExpressionFunctionApplication |
| _m.FunctionApplication = functionApplication |
| } |
| |
| func ExpressionWithFunctionApplication(functionApplication FunctionApplication) Expression { |
| var _u Expression |
| _u.SetFunctionApplication(functionApplication) |
| return _u |
| } |
| func (_m *Expression) GetUnknownData() _bindings.UnknownData { |
| return _m.I_unknownData.(_bindings.UnknownData) |
| } |
| |
| type I_someProtocolSomeMethodResultTag uint64 |
| |
| const ( |
| SomeProtocolSomeMethodResultResponse = 1 // 0x00000001 |
| SomeProtocolSomeMethodResultErr = 2 // 0x00000002 |
| ) |
| |
| type SomeProtocolSomeMethodResult struct { |
| I_someProtocolSomeMethodResultTag `fidl:"x!" fidl_size_v2:"16" fidl_alignment_v2:"8" fidl_resource:"false"` |
| Response SomeProtocolSomeMethodResponse `fidl_ordinal:"1"` |
| Err SomeProtocolSomeMethodError `fidl_ordinal:"2"` |
| } |
| |
| var _mSomeProtocolSomeMethodResult = _bindings.CreateLazyMarshaler(SomeProtocolSomeMethodResult{}) |
| |
| func (msg *SomeProtocolSomeMethodResult) Marshaler() _bindings.Marshaler { |
| return _mSomeProtocolSomeMethodResult |
| } |
| |
| func (_m *SomeProtocolSomeMethodResult) reset() { |
| switch _m.I_someProtocolSomeMethodResultTag { |
| case 1: |
| var _zeroed SomeProtocolSomeMethodResponse |
| _m.Response = _zeroed |
| case 2: |
| var _zeroed SomeProtocolSomeMethodError |
| _m.Err = _zeroed |
| } |
| } |
| |
| func (_m *SomeProtocolSomeMethodResult) Which() I_someProtocolSomeMethodResultTag { |
| return _m.I_someProtocolSomeMethodResultTag |
| } |
| |
| func (_m *SomeProtocolSomeMethodResult) Ordinal() uint64 { |
| return uint64(_m.I_someProtocolSomeMethodResultTag) |
| } |
| |
| func (_m *SomeProtocolSomeMethodResult) SetResponse(response SomeProtocolSomeMethodResponse) { |
| _m.reset() |
| _m.I_someProtocolSomeMethodResultTag = SomeProtocolSomeMethodResultResponse |
| _m.Response = response |
| } |
| |
| func SomeProtocolSomeMethodResultWithResponse(response SomeProtocolSomeMethodResponse) SomeProtocolSomeMethodResult { |
| var _u SomeProtocolSomeMethodResult |
| _u.SetResponse(response) |
| return _u |
| } |
| |
| func (_m *SomeProtocolSomeMethodResult) SetErr(err SomeProtocolSomeMethodError) { |
| _m.reset() |
| _m.I_someProtocolSomeMethodResultTag = SomeProtocolSomeMethodResultErr |
| _m.Err = err |
| } |
| |
| func SomeProtocolSomeMethodResultWithErr(err SomeProtocolSomeMethodError) SomeProtocolSomeMethodResult { |
| var _u SomeProtocolSomeMethodResult |
| _u.SetErr(err) |
| return _u |
| } |
| |
| type I_unionMemberTag uint64 |
| |
| const ( |
| UnionMember_unknownData = 0 // 0x00000000 |
| UnionMemberUnionData = 2 // 0x00000002 |
| ) |
| |
| type UnionMember struct { |
| I_unionMemberTag `fidl:"x" fidl_size_v2:"16" fidl_alignment_v2:"8" fidl_resource:"false"` |
| I_unknownData interface{} |
| UnionData uint8 `fidl_ordinal:"2"` |
| } |
| |
| var _mUnionMember = _bindings.CreateLazyMarshaler(UnionMember{}) |
| |
| func (msg *UnionMember) Marshaler() _bindings.Marshaler { |
| return _mUnionMember |
| } |
| |
| func (_m *UnionMember) reset() { |
| switch _m.I_unionMemberTag { |
| case 2: |
| var _zeroed uint8 |
| _m.UnionData = _zeroed |
| default: |
| var _zeroed interface{} |
| _m.I_unknownData = _zeroed |
| } |
| } |
| |
| func (_m *UnionMember) Which() I_unionMemberTag { |
| switch _m.I_unionMemberTag { |
| case 2: |
| return UnionMemberUnionData |
| default: |
| return UnionMember_unknownData |
| } |
| } |
| |
| func (_m *UnionMember) Ordinal() uint64 { |
| return uint64(_m.I_unionMemberTag) |
| } |
| |
| func (_m *UnionMember) SetUnionData(unionData uint8) { |
| _m.reset() |
| _m.I_unionMemberTag = UnionMemberUnionData |
| _m.UnionData = unionData |
| } |
| |
| func UnionMemberWithUnionData(unionData uint8) UnionMember { |
| var _u UnionMember |
| _u.SetUnionData(unionData) |
| return _u |
| } |
| func (_m *UnionMember) GetUnknownData() _bindings.UnknownData { |
| return _m.I_unknownData.(_bindings.UnknownData) |
| } |
| |
| type FunctionApplication struct { |
| _ struct{} `fidl:"t" fidl_size_v2:"16" fidl_alignment_v2:"8" fidl_resource:"false"` |
| I_unknownData interface{} |
| Func string `fidl_bounds:"100" fidl_ordinal:"1"` |
| FuncPresent bool |
| Args []*Expression `fidl_bounds:"5" fidl_ordinal:"3"` |
| ArgsPresent bool |
| Flags Flags `fidl_ordinal:"4"` |
| FlagsPresent bool |
| } |
| |
| var _mFunctionApplication = _bindings.CreateLazyMarshaler(FunctionApplication{}) |
| |
| func (msg *FunctionApplication) Marshaler() _bindings.Marshaler { |
| return _mFunctionApplication |
| } |
| |
| func (u *FunctionApplication) SetFunc(func_ string) { |
| u.Func = func_ |
| u.FuncPresent = true |
| } |
| |
| func (u *FunctionApplication) GetFunc() string { |
| return u.Func |
| } |
| |
| func (u *FunctionApplication) GetFuncWithDefault(_default string) string { |
| if !u.HasFunc() { |
| return _default |
| } |
| return u.Func |
| } |
| |
| func (u *FunctionApplication) HasFunc() bool { |
| return u.FuncPresent |
| } |
| |
| func (u *FunctionApplication) ClearFunc() { |
| u.FuncPresent = false |
| } |
| |
| func (u *FunctionApplication) SetArgs(args []*Expression) { |
| u.Args = args |
| u.ArgsPresent = true |
| } |
| |
| func (u *FunctionApplication) GetArgs() []*Expression { |
| return u.Args |
| } |
| |
| func (u *FunctionApplication) GetArgsWithDefault(_default []*Expression) []*Expression { |
| if !u.HasArgs() { |
| return _default |
| } |
| return u.Args |
| } |
| |
| func (u *FunctionApplication) HasArgs() bool { |
| return u.ArgsPresent |
| } |
| |
| func (u *FunctionApplication) ClearArgs() { |
| u.ArgsPresent = false |
| } |
| |
| func (u *FunctionApplication) SetFlags(flags Flags) { |
| u.Flags = flags |
| u.FlagsPresent = true |
| } |
| |
| func (u *FunctionApplication) GetFlags() Flags { |
| return u.Flags |
| } |
| |
| func (u *FunctionApplication) GetFlagsWithDefault(_default Flags) Flags { |
| if !u.HasFlags() { |
| return _default |
| } |
| return u.Flags |
| } |
| |
| func (u *FunctionApplication) HasFlags() bool { |
| return u.FlagsPresent |
| } |
| |
| func (u *FunctionApplication) ClearFlags() { |
| u.FlagsPresent = false |
| } |
| |
| func (u *FunctionApplication) HasUnknownData() bool { |
| return u.I_unknownData != nil |
| } |
| |
| func (u *FunctionApplication) GetUnknownData() map[uint64]_bindings.UnknownData { |
| return u.I_unknownData.(map[uint64]_bindings.UnknownData) |
| } |
| |
| type TableMember struct { |
| _ struct{} `fidl:"t" fidl_size_v2:"16" fidl_alignment_v2:"8" fidl_resource:"false"` |
| I_unknownData interface{} |
| TableData []TableData `fidl_bounds:"10" fidl_ordinal:"2"` |
| TableDataPresent bool |
| } |
| |
| var _mTableMember = _bindings.CreateLazyMarshaler(TableMember{}) |
| |
| func (msg *TableMember) Marshaler() _bindings.Marshaler { |
| return _mTableMember |
| } |
| |
| func (u *TableMember) SetTableData(tableData []TableData) { |
| u.TableData = tableData |
| u.TableDataPresent = true |
| } |
| |
| func (u *TableMember) GetTableData() []TableData { |
| return u.TableData |
| } |
| |
| func (u *TableMember) GetTableDataWithDefault(_default []TableData) []TableData { |
| if !u.HasTableData() { |
| return _default |
| } |
| return u.TableData |
| } |
| |
| func (u *TableMember) HasTableData() bool { |
| return u.TableDataPresent |
| } |
| |
| func (u *TableMember) ClearTableData() { |
| u.TableDataPresent = false |
| } |
| |
| func (u *TableMember) HasUnknownData() bool { |
| return u.I_unknownData != nil |
| } |
| |
| func (u *TableMember) GetUnknownData() map[uint64]_bindings.UnknownData { |
| return u.I_unknownData.(map[uint64]_bindings.UnknownData) |
| } |
| |
| const ( |
| SomeProtocolSomeMethodOrdinal uint64 = 0x22ea52ec7a5146d8 |
| ) |
| |
| type SomeProtocolWithCtxInterface _bindings.ChannelProxy |
| |
| func (p *SomeProtocolWithCtxInterface) SomeMethod(ctx_ _bindings.Context, unionMember UnionMember, tableMember TableMember) (SomeProtocolSomeMethodResult, error) { |
| req_ := &someProtocolWithCtxSomeMethodRequest{UnionMember: unionMember, TableMember: tableMember} |
| resp_ := &someProtocolWithCtxSomeMethodResponse{} |
| err_ := ((*_bindings.ChannelProxy)(p)).Call(SomeProtocolSomeMethodOrdinal, req_, resp_) |
| return (*resp_).Result, err_ |
| } |
| |
| type SomeProtocolWithCtx interface { |
| SomeMethod(ctx_ _bindings.Context, unionMember UnionMember, tableMember TableMember) (SomeProtocolSomeMethodResult, error) |
| } |
| |
| type SomeProtocolWithCtxTransitionalBase struct{} |
| |
| type SomeProtocolWithCtxInterfaceRequest _bindings.InterfaceRequest |
| |
| func NewSomeProtocolWithCtxInterfaceRequest() (SomeProtocolWithCtxInterfaceRequest, *SomeProtocolWithCtxInterface, error) { |
| req, cli, err := _bindings.NewInterfaceRequest() |
| return SomeProtocolWithCtxInterfaceRequest(req), (*SomeProtocolWithCtxInterface)(cli), err |
| } |
| |
| type SomeProtocolWithCtxStub struct { |
| Impl SomeProtocolWithCtx |
| } |
| |
| func (s_ *SomeProtocolWithCtxStub) Dispatch(args_ _bindings.DispatchArgs) (_bindings.Message, bool, error) { |
| switch args_.Ordinal { |
| case SomeProtocolSomeMethodOrdinal: |
| in_ := &someProtocolWithCtxSomeMethodRequest{} |
| marshalerCtx, ok := _bindings.GetMarshalerContext(args_.Ctx) |
| if !ok { |
| return nil, false, _bindings.ErrMissingMarshalerContext |
| } |
| if err_ := _bindings.Unmarshal(marshalerCtx, args_.Bytes, args_.HandleInfos, in_); err_ != nil { |
| return nil, false, err_ |
| } |
| result, err_ := s_.Impl.SomeMethod(args_.Ctx, (*in_).UnionMember, (*in_).TableMember) |
| out_ := &someProtocolWithCtxSomeMethodResponse{Result: result} |
| return out_, true, err_ |
| } |
| return nil, false, _bindings.ErrUnknownOrdinal |
| } |
| |
| type SomeProtocolEventProxy _bindings.ChannelProxy |