| // WARNING: This file is machine generated by fidlgen. |
| |
| // fidl_experiment = output_index_json |
| |
| package protocolpayloads |
| |
| import ( |
| testprotocolpayloadsimported "fidl/test/protocolpayloads/imported" |
| _bindings "syscall/zx/fidl" |
| ) |
| |
| type LocalStructPayload struct { |
| _ struct{} `fidl:"s" fidl_size_v2:"8" fidl_alignment_v2:"4"` |
| A uint32 `fidl_offset_v2:"0"` |
| B uint32 `fidl_offset_v2:"4"` |
| } |
| |
| var _mLocalStructPayload = _bindings.CreateLazyMarshaler(LocalStructPayload{}) |
| |
| func (msg *LocalStructPayload) Marshaler() _bindings.Marshaler { |
| return _mLocalStructPayload |
| } |
| |
| type MainProtocolOnAnonRequest struct { |
| _ struct{} `fidl:"s" fidl_size_v2:"8" fidl_alignment_v2:"4"` |
| A uint32 `fidl_offset_v2:"0"` |
| B uint32 `fidl_offset_v2:"4"` |
| } |
| |
| var _mMainProtocolOnAnonRequest = _bindings.CreateLazyMarshaler(MainProtocolOnAnonRequest{}) |
| |
| func (msg *MainProtocolOnAnonRequest) Marshaler() _bindings.Marshaler { |
| return _mMainProtocolOnAnonRequest |
| } |
| |
| type MainProtocolOneWayAnonRequest struct { |
| _ struct{} `fidl:"s" fidl_size_v2:"8" fidl_alignment_v2:"4"` |
| A uint32 `fidl_offset_v2:"0"` |
| B uint32 `fidl_offset_v2:"4"` |
| } |
| |
| var _mMainProtocolOneWayAnonRequest = _bindings.CreateLazyMarshaler(MainProtocolOneWayAnonRequest{}) |
| |
| func (msg *MainProtocolOneWayAnonRequest) Marshaler() _bindings.Marshaler { |
| return _mMainProtocolOneWayAnonRequest |
| } |
| |
| type MainProtocolTwoWayAnonRequest struct { |
| _ struct{} `fidl:"s" fidl_size_v2:"8" fidl_alignment_v2:"4"` |
| A uint32 `fidl_offset_v2:"0"` |
| B uint32 `fidl_offset_v2:"4"` |
| } |
| |
| var _mMainProtocolTwoWayAnonRequest = _bindings.CreateLazyMarshaler(MainProtocolTwoWayAnonRequest{}) |
| |
| func (msg *MainProtocolTwoWayAnonRequest) Marshaler() _bindings.Marshaler { |
| return _mMainProtocolTwoWayAnonRequest |
| } |
| |
| type MainProtocolTwoWayAnonResponse struct { |
| _ struct{} `fidl:"s" fidl_size_v2:"8" fidl_alignment_v2:"4"` |
| A uint32 `fidl_offset_v2:"0"` |
| B uint32 `fidl_offset_v2:"4"` |
| } |
| |
| var _mMainProtocolTwoWayAnonResponse = _bindings.CreateLazyMarshaler(MainProtocolTwoWayAnonResponse{}) |
| |
| func (msg *MainProtocolTwoWayAnonResponse) Marshaler() _bindings.Marshaler { |
| return _mMainProtocolTwoWayAnonResponse |
| } |
| |
| type MainProtocolTwoWayAnonWithErrorRequest struct { |
| _ struct{} `fidl:"s" fidl_size_v2:"8" fidl_alignment_v2:"4"` |
| A uint32 `fidl_offset_v2:"0"` |
| B uint32 `fidl_offset_v2:"4"` |
| } |
| |
| var _mMainProtocolTwoWayAnonWithErrorRequest = _bindings.CreateLazyMarshaler(MainProtocolTwoWayAnonWithErrorRequest{}) |
| |
| func (msg *MainProtocolTwoWayAnonWithErrorRequest) Marshaler() _bindings.Marshaler { |
| return _mMainProtocolTwoWayAnonWithErrorRequest |
| } |
| |
| type MainProtocolTwoWayAnonWithErrorResponse struct { |
| _ struct{} `fidl:"s" fidl_size_v2:"8" fidl_alignment_v2:"4"` |
| A uint32 `fidl_offset_v2:"0"` |
| B uint32 `fidl_offset_v2:"4"` |
| } |
| |
| var _mMainProtocolTwoWayAnonWithErrorResponse = _bindings.CreateLazyMarshaler(MainProtocolTwoWayAnonWithErrorResponse{}) |
| |
| func (msg *MainProtocolTwoWayAnonWithErrorResponse) Marshaler() _bindings.Marshaler { |
| return _mMainProtocolTwoWayAnonWithErrorResponse |
| } |
| |
| type I_mainProtocolTwoWayAnonWithErrorResultTag uint64 |
| |
| const ( |
| MainProtocolTwoWayAnonWithErrorResultResponse = 1 // 0x00000001 |
| MainProtocolTwoWayAnonWithErrorResultErr = 2 // 0x00000002 |
| ) |
| |
| type MainProtocolTwoWayAnonWithErrorResult struct { |
| I_mainProtocolTwoWayAnonWithErrorResultTag `fidl:"x!" fidl_size_v2:"16" fidl_alignment_v2:"8" fidl_resource:"false"` |
| Response MainProtocolTwoWayAnonWithErrorResponse `fidl_ordinal:"1"` |
| Err uint32 `fidl_ordinal:"2"` |
| } |
| |
| var _mMainProtocolTwoWayAnonWithErrorResult = _bindings.CreateLazyMarshaler(MainProtocolTwoWayAnonWithErrorResult{}) |
| |
| func (msg *MainProtocolTwoWayAnonWithErrorResult) Marshaler() _bindings.Marshaler { |
| return _mMainProtocolTwoWayAnonWithErrorResult |
| } |
| |
| func (_m *MainProtocolTwoWayAnonWithErrorResult) reset() { |
| switch _m.I_mainProtocolTwoWayAnonWithErrorResultTag { |
| case 1: |
| var _zeroed MainProtocolTwoWayAnonWithErrorResponse |
| _m.Response = _zeroed |
| case 2: |
| var _zeroed uint32 |
| _m.Err = _zeroed |
| } |
| } |
| |
| func (_m *MainProtocolTwoWayAnonWithErrorResult) Which() I_mainProtocolTwoWayAnonWithErrorResultTag { |
| return _m.I_mainProtocolTwoWayAnonWithErrorResultTag |
| } |
| |
| func (_m *MainProtocolTwoWayAnonWithErrorResult) Ordinal() uint64 { |
| return uint64(_m.I_mainProtocolTwoWayAnonWithErrorResultTag) |
| } |
| |
| func (_m *MainProtocolTwoWayAnonWithErrorResult) SetResponse(response MainProtocolTwoWayAnonWithErrorResponse) { |
| _m.reset() |
| _m.I_mainProtocolTwoWayAnonWithErrorResultTag = MainProtocolTwoWayAnonWithErrorResultResponse |
| _m.Response = response |
| } |
| |
| func MainProtocolTwoWayAnonWithErrorResultWithResponse(response MainProtocolTwoWayAnonWithErrorResponse) MainProtocolTwoWayAnonWithErrorResult { |
| var _u MainProtocolTwoWayAnonWithErrorResult |
| _u.SetResponse(response) |
| return _u |
| } |
| |
| func (_m *MainProtocolTwoWayAnonWithErrorResult) SetErr(err uint32) { |
| _m.reset() |
| _m.I_mainProtocolTwoWayAnonWithErrorResultTag = MainProtocolTwoWayAnonWithErrorResultErr |
| _m.Err = err |
| } |
| |
| func MainProtocolTwoWayAnonWithErrorResultWithErr(err uint32) MainProtocolTwoWayAnonWithErrorResult { |
| var _u MainProtocolTwoWayAnonWithErrorResult |
| _u.SetErr(err) |
| return _u |
| } |
| |
| type I_mainProtocolTwoWayImportWithErrorResultTag uint64 |
| |
| const ( |
| MainProtocolTwoWayImportWithErrorResultResponse = 1 // 0x00000001 |
| MainProtocolTwoWayImportWithErrorResultErr = 2 // 0x00000002 |
| ) |
| |
| type MainProtocolTwoWayImportWithErrorResult struct { |
| I_mainProtocolTwoWayImportWithErrorResultTag `fidl:"x!" fidl_size_v2:"16" fidl_alignment_v2:"8" fidl_resource:"false"` |
| Response testprotocolpayloadsimported.ImportStructPayload `fidl_ordinal:"1"` |
| Err uint32 `fidl_ordinal:"2"` |
| } |
| |
| var _mMainProtocolTwoWayImportWithErrorResult = _bindings.CreateLazyMarshaler(MainProtocolTwoWayImportWithErrorResult{}) |
| |
| func (msg *MainProtocolTwoWayImportWithErrorResult) Marshaler() _bindings.Marshaler { |
| return _mMainProtocolTwoWayImportWithErrorResult |
| } |
| |
| func (_m *MainProtocolTwoWayImportWithErrorResult) reset() { |
| switch _m.I_mainProtocolTwoWayImportWithErrorResultTag { |
| case 1: |
| var _zeroed testprotocolpayloadsimported.ImportStructPayload |
| _m.Response = _zeroed |
| case 2: |
| var _zeroed uint32 |
| _m.Err = _zeroed |
| } |
| } |
| |
| func (_m *MainProtocolTwoWayImportWithErrorResult) Which() I_mainProtocolTwoWayImportWithErrorResultTag { |
| return _m.I_mainProtocolTwoWayImportWithErrorResultTag |
| } |
| |
| func (_m *MainProtocolTwoWayImportWithErrorResult) Ordinal() uint64 { |
| return uint64(_m.I_mainProtocolTwoWayImportWithErrorResultTag) |
| } |
| |
| func (_m *MainProtocolTwoWayImportWithErrorResult) SetResponse(response testprotocolpayloadsimported.ImportStructPayload) { |
| _m.reset() |
| _m.I_mainProtocolTwoWayImportWithErrorResultTag = MainProtocolTwoWayImportWithErrorResultResponse |
| _m.Response = response |
| } |
| |
| func MainProtocolTwoWayImportWithErrorResultWithResponse(response testprotocolpayloadsimported.ImportStructPayload) MainProtocolTwoWayImportWithErrorResult { |
| var _u MainProtocolTwoWayImportWithErrorResult |
| _u.SetResponse(response) |
| return _u |
| } |
| |
| func (_m *MainProtocolTwoWayImportWithErrorResult) SetErr(err uint32) { |
| _m.reset() |
| _m.I_mainProtocolTwoWayImportWithErrorResultTag = MainProtocolTwoWayImportWithErrorResultErr |
| _m.Err = err |
| } |
| |
| func MainProtocolTwoWayImportWithErrorResultWithErr(err uint32) MainProtocolTwoWayImportWithErrorResult { |
| var _u MainProtocolTwoWayImportWithErrorResult |
| _u.SetErr(err) |
| return _u |
| } |
| |
| type I_mainProtocolTwoWayLocalWithErrorResultTag uint64 |
| |
| const ( |
| MainProtocolTwoWayLocalWithErrorResultResponse = 1 // 0x00000001 |
| MainProtocolTwoWayLocalWithErrorResultErr = 2 // 0x00000002 |
| ) |
| |
| type MainProtocolTwoWayLocalWithErrorResult struct { |
| I_mainProtocolTwoWayLocalWithErrorResultTag `fidl:"x!" fidl_size_v2:"16" fidl_alignment_v2:"8" fidl_resource:"false"` |
| Response LocalStructPayload `fidl_ordinal:"1"` |
| Err uint32 `fidl_ordinal:"2"` |
| } |
| |
| var _mMainProtocolTwoWayLocalWithErrorResult = _bindings.CreateLazyMarshaler(MainProtocolTwoWayLocalWithErrorResult{}) |
| |
| func (msg *MainProtocolTwoWayLocalWithErrorResult) Marshaler() _bindings.Marshaler { |
| return _mMainProtocolTwoWayLocalWithErrorResult |
| } |
| |
| func (_m *MainProtocolTwoWayLocalWithErrorResult) reset() { |
| switch _m.I_mainProtocolTwoWayLocalWithErrorResultTag { |
| case 1: |
| var _zeroed LocalStructPayload |
| _m.Response = _zeroed |
| case 2: |
| var _zeroed uint32 |
| _m.Err = _zeroed |
| } |
| } |
| |
| func (_m *MainProtocolTwoWayLocalWithErrorResult) Which() I_mainProtocolTwoWayLocalWithErrorResultTag { |
| return _m.I_mainProtocolTwoWayLocalWithErrorResultTag |
| } |
| |
| func (_m *MainProtocolTwoWayLocalWithErrorResult) Ordinal() uint64 { |
| return uint64(_m.I_mainProtocolTwoWayLocalWithErrorResultTag) |
| } |
| |
| func (_m *MainProtocolTwoWayLocalWithErrorResult) SetResponse(response LocalStructPayload) { |
| _m.reset() |
| _m.I_mainProtocolTwoWayLocalWithErrorResultTag = MainProtocolTwoWayLocalWithErrorResultResponse |
| _m.Response = response |
| } |
| |
| func MainProtocolTwoWayLocalWithErrorResultWithResponse(response LocalStructPayload) MainProtocolTwoWayLocalWithErrorResult { |
| var _u MainProtocolTwoWayLocalWithErrorResult |
| _u.SetResponse(response) |
| return _u |
| } |
| |
| func (_m *MainProtocolTwoWayLocalWithErrorResult) SetErr(err uint32) { |
| _m.reset() |
| _m.I_mainProtocolTwoWayLocalWithErrorResultTag = MainProtocolTwoWayLocalWithErrorResultErr |
| _m.Err = err |
| } |
| |
| func MainProtocolTwoWayLocalWithErrorResultWithErr(err uint32) MainProtocolTwoWayLocalWithErrorResult { |
| var _u MainProtocolTwoWayLocalWithErrorResult |
| _u.SetErr(err) |
| return _u |
| } |
| |
| const ( |
| MainProtocolOneWayComposedOrdinal uint64 = 0x241e4384443ccb10 |
| MainProtocolTwoWayComposedOrdinal uint64 = 0x2348a1331ca4cfb0 |
| MainProtocolTwoWayComposedWithErrorOrdinal uint64 = 0x6a9be48b574d1557 |
| MainProtocolOnComposedOrdinal uint64 = 0x19fbe2b2f6f9273a |
| MainProtocolOneWayLocalOrdinal uint64 = 0x6b9feaf9305b0715 |
| MainProtocolTwoWayLocalOrdinal uint64 = 0x743776548de3af0f |
| MainProtocolTwoWayLocalWithErrorOrdinal uint64 = 0x2839c029915cb8fc |
| MainProtocolOnLocalOrdinal uint64 = 0x4745f7438cd80819 |
| MainProtocolOneWayImportOrdinal uint64 = 0x2e6b091ae4cee40c |
| MainProtocolTwoWayImportOrdinal uint64 = 0x20f4a8f65ff69473 |
| MainProtocolTwoWayImportWithErrorOrdinal uint64 = 0x3b7b706d42eb9bbd |
| MainProtocolOnImportOrdinal uint64 = 0x1bb4f4c30b6f8909 |
| MainProtocolOneWayAnonOrdinal uint64 = 0xb43565c01ab54ac |
| MainProtocolTwoWayAnonOrdinal uint64 = 0x8bdc969ff7dd759 |
| MainProtocolTwoWayAnonWithErrorOrdinal uint64 = 0x5862bf8170c87a36 |
| MainProtocolOnAnonOrdinal uint64 = 0x42d321dacc4df000 |
| ) |
| |
| type MainProtocolWithCtxInterface _bindings.ChannelProxy |
| |
| func (p *MainProtocolWithCtxInterface) OneWayComposed(ctx_ _bindings.Context, a int32) error { |
| req_ := &testprotocolpayloadsimported.ImportStructPayload{A: a} |
| err_ := ((*_bindings.ChannelProxy)(p)).Send(MainProtocolOneWayComposedOrdinal, req_) |
| return err_ |
| } |
| |
| func (p *MainProtocolWithCtxInterface) TwoWayComposed(ctx_ _bindings.Context, a int32) (int32, error) { |
| req_ := &testprotocolpayloadsimported.ImportStructPayload{A: a} |
| resp_ := &testprotocolpayloadsimported.ImportStructPayload{} |
| err_ := ((*_bindings.ChannelProxy)(p)).Call(MainProtocolTwoWayComposedOrdinal, req_, resp_) |
| return (*resp_).A, err_ |
| } |
| |
| func (p *MainProtocolWithCtxInterface) TwoWayComposedWithError(ctx_ _bindings.Context, a int32) (testprotocolpayloadsimported.ComposedProtocolTwoWayComposedWithErrorResult, error) { |
| req_ := &testprotocolpayloadsimported.ImportStructPayload{A: a} |
| resp_ := &testprotocolpayloadsimported.ComposedProtocolTwoWayComposedWithErrorResult{} |
| err_ := ((*_bindings.ChannelProxy)(p)).Call(MainProtocolTwoWayComposedWithErrorOrdinal, req_, resp_) |
| return (*resp_), err_ |
| } |
| |
| func (p *MainProtocolWithCtxInterface) ExpectOnComposed(ctx_ _bindings.Context) (int32, error) { |
| resp_ := &testprotocolpayloadsimported.ImportStructPayload{} |
| err_ := ((*_bindings.ChannelProxy)(p)).Recv(MainProtocolOnComposedOrdinal, resp_) |
| return (*resp_).A, err_ |
| } |
| |
| func (p *MainProtocolWithCtxInterface) OneWayLocal(ctx_ _bindings.Context, a uint32, b uint32) error { |
| req_ := &LocalStructPayload{A: a, B: b} |
| err_ := ((*_bindings.ChannelProxy)(p)).Send(MainProtocolOneWayLocalOrdinal, req_) |
| return err_ |
| } |
| |
| func (p *MainProtocolWithCtxInterface) TwoWayLocal(ctx_ _bindings.Context, a uint32, b uint32) (uint32, uint32, error) { |
| req_ := &LocalStructPayload{A: a, B: b} |
| resp_ := &LocalStructPayload{} |
| err_ := ((*_bindings.ChannelProxy)(p)).Call(MainProtocolTwoWayLocalOrdinal, req_, resp_) |
| return (*resp_).A, (*resp_).B, err_ |
| } |
| |
| func (p *MainProtocolWithCtxInterface) TwoWayLocalWithError(ctx_ _bindings.Context, a uint32, b uint32) (MainProtocolTwoWayLocalWithErrorResult, error) { |
| req_ := &LocalStructPayload{A: a, B: b} |
| resp_ := &MainProtocolTwoWayLocalWithErrorResult{} |
| err_ := ((*_bindings.ChannelProxy)(p)).Call(MainProtocolTwoWayLocalWithErrorOrdinal, req_, resp_) |
| return (*resp_), err_ |
| } |
| |
| func (p *MainProtocolWithCtxInterface) ExpectOnLocal(ctx_ _bindings.Context) (uint32, uint32, error) { |
| resp_ := &LocalStructPayload{} |
| err_ := ((*_bindings.ChannelProxy)(p)).Recv(MainProtocolOnLocalOrdinal, resp_) |
| return (*resp_).A, (*resp_).B, err_ |
| } |
| |
| func (p *MainProtocolWithCtxInterface) OneWayImport(ctx_ _bindings.Context, a int32) error { |
| req_ := &testprotocolpayloadsimported.ImportStructPayload{A: a} |
| err_ := ((*_bindings.ChannelProxy)(p)).Send(MainProtocolOneWayImportOrdinal, req_) |
| return err_ |
| } |
| |
| func (p *MainProtocolWithCtxInterface) TwoWayImport(ctx_ _bindings.Context, a int32) (int32, error) { |
| req_ := &testprotocolpayloadsimported.ImportStructPayload{A: a} |
| resp_ := &testprotocolpayloadsimported.ImportStructPayload{} |
| err_ := ((*_bindings.ChannelProxy)(p)).Call(MainProtocolTwoWayImportOrdinal, req_, resp_) |
| return (*resp_).A, err_ |
| } |
| |
| func (p *MainProtocolWithCtxInterface) TwoWayImportWithError(ctx_ _bindings.Context, a int32) (MainProtocolTwoWayImportWithErrorResult, error) { |
| req_ := &testprotocolpayloadsimported.ImportStructPayload{A: a} |
| resp_ := &MainProtocolTwoWayImportWithErrorResult{} |
| err_ := ((*_bindings.ChannelProxy)(p)).Call(MainProtocolTwoWayImportWithErrorOrdinal, req_, resp_) |
| return (*resp_), err_ |
| } |
| |
| func (p *MainProtocolWithCtxInterface) ExpectOnImport(ctx_ _bindings.Context) (int32, error) { |
| resp_ := &testprotocolpayloadsimported.ImportStructPayload{} |
| err_ := ((*_bindings.ChannelProxy)(p)).Recv(MainProtocolOnImportOrdinal, resp_) |
| return (*resp_).A, err_ |
| } |
| |
| func (p *MainProtocolWithCtxInterface) OneWayAnon(ctx_ _bindings.Context, a uint32, b uint32) error { |
| req_ := &MainProtocolOneWayAnonRequest{A: a, B: b} |
| err_ := ((*_bindings.ChannelProxy)(p)).Send(MainProtocolOneWayAnonOrdinal, req_) |
| return err_ |
| } |
| |
| func (p *MainProtocolWithCtxInterface) TwoWayAnon(ctx_ _bindings.Context, a uint32, b uint32) (uint32, uint32, error) { |
| req_ := &MainProtocolTwoWayAnonRequest{A: a, B: b} |
| resp_ := &MainProtocolTwoWayAnonResponse{} |
| err_ := ((*_bindings.ChannelProxy)(p)).Call(MainProtocolTwoWayAnonOrdinal, req_, resp_) |
| return (*resp_).A, (*resp_).B, err_ |
| } |
| |
| func (p *MainProtocolWithCtxInterface) TwoWayAnonWithError(ctx_ _bindings.Context, a uint32, b uint32) (MainProtocolTwoWayAnonWithErrorResult, error) { |
| req_ := &MainProtocolTwoWayAnonWithErrorRequest{A: a, B: b} |
| resp_ := &MainProtocolTwoWayAnonWithErrorResult{} |
| err_ := ((*_bindings.ChannelProxy)(p)).Call(MainProtocolTwoWayAnonWithErrorOrdinal, req_, resp_) |
| return (*resp_), err_ |
| } |
| |
| func (p *MainProtocolWithCtxInterface) ExpectOnAnon(ctx_ _bindings.Context) (uint32, uint32, error) { |
| resp_ := &MainProtocolOnAnonRequest{} |
| err_ := ((*_bindings.ChannelProxy)(p)).Recv(MainProtocolOnAnonOrdinal, resp_) |
| return (*resp_).A, (*resp_).B, err_ |
| } |
| |
| type MainProtocolWithCtx interface { |
| OneWayComposed(ctx_ _bindings.Context, a int32) error |
| TwoWayComposed(ctx_ _bindings.Context, a int32) (int32, error) |
| TwoWayComposedWithError(ctx_ _bindings.Context, a int32) (testprotocolpayloadsimported.ComposedProtocolTwoWayComposedWithErrorResult, error) |
| OneWayLocal(ctx_ _bindings.Context, a uint32, b uint32) error |
| TwoWayLocal(ctx_ _bindings.Context, a uint32, b uint32) (uint32, uint32, error) |
| TwoWayLocalWithError(ctx_ _bindings.Context, a uint32, b uint32) (MainProtocolTwoWayLocalWithErrorResult, error) |
| OneWayImport(ctx_ _bindings.Context, a int32) error |
| TwoWayImport(ctx_ _bindings.Context, a int32) (int32, error) |
| TwoWayImportWithError(ctx_ _bindings.Context, a int32) (MainProtocolTwoWayImportWithErrorResult, error) |
| OneWayAnon(ctx_ _bindings.Context, a uint32, b uint32) error |
| TwoWayAnon(ctx_ _bindings.Context, a uint32, b uint32) (uint32, uint32, error) |
| TwoWayAnonWithError(ctx_ _bindings.Context, a uint32, b uint32) (MainProtocolTwoWayAnonWithErrorResult, error) |
| } |
| type MainProtocolWithCtxInterfaceRequest _bindings.InterfaceRequest |
| |
| func NewMainProtocolWithCtxInterfaceRequest() (MainProtocolWithCtxInterfaceRequest, *MainProtocolWithCtxInterface, error) { |
| req, cli, err := _bindings.NewInterfaceRequest() |
| return MainProtocolWithCtxInterfaceRequest(req), (*MainProtocolWithCtxInterface)(cli), err |
| } |
| |
| type MainProtocolWithCtxStub struct { |
| Impl MainProtocolWithCtx |
| } |
| |
| func (s_ *MainProtocolWithCtxStub) Dispatch(args_ _bindings.DispatchArgs) (_bindings.Message, bool, error) { |
| switch args_.Ordinal { |
| case MainProtocolOneWayComposedOrdinal: |
| in_ := &testprotocolpayloadsimported.ImportStructPayload{} |
| 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_ |
| } |
| err_ := s_.Impl.OneWayComposed(args_.Ctx, (*in_).A) |
| return nil, false, err_ |
| case MainProtocolTwoWayComposedOrdinal: |
| in_ := &testprotocolpayloadsimported.ImportStructPayload{} |
| 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_ |
| } |
| a, err_ := s_.Impl.TwoWayComposed(args_.Ctx, (*in_).A) |
| out_ := &testprotocolpayloadsimported.ImportStructPayload{A: a} |
| return out_, true, err_ |
| case MainProtocolTwoWayComposedWithErrorOrdinal: |
| in_ := &testprotocolpayloadsimported.ImportStructPayload{} |
| 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_ |
| } |
| payload, err_ := s_.Impl.TwoWayComposedWithError(args_.Ctx, (*in_).A) |
| out_ := &payload |
| return out_, true, err_ |
| case MainProtocolOneWayLocalOrdinal: |
| in_ := &LocalStructPayload{} |
| 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_ |
| } |
| err_ := s_.Impl.OneWayLocal(args_.Ctx, (*in_).A, (*in_).B) |
| return nil, false, err_ |
| case MainProtocolTwoWayLocalOrdinal: |
| in_ := &LocalStructPayload{} |
| 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_ |
| } |
| a, b, err_ := s_.Impl.TwoWayLocal(args_.Ctx, (*in_).A, (*in_).B) |
| out_ := &LocalStructPayload{A: a, B: b} |
| return out_, true, err_ |
| case MainProtocolTwoWayLocalWithErrorOrdinal: |
| in_ := &LocalStructPayload{} |
| 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_ |
| } |
| payload, err_ := s_.Impl.TwoWayLocalWithError(args_.Ctx, (*in_).A, (*in_).B) |
| out_ := &payload |
| return out_, true, err_ |
| case MainProtocolOneWayImportOrdinal: |
| in_ := &testprotocolpayloadsimported.ImportStructPayload{} |
| 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_ |
| } |
| err_ := s_.Impl.OneWayImport(args_.Ctx, (*in_).A) |
| return nil, false, err_ |
| case MainProtocolTwoWayImportOrdinal: |
| in_ := &testprotocolpayloadsimported.ImportStructPayload{} |
| 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_ |
| } |
| a, err_ := s_.Impl.TwoWayImport(args_.Ctx, (*in_).A) |
| out_ := &testprotocolpayloadsimported.ImportStructPayload{A: a} |
| return out_, true, err_ |
| case MainProtocolTwoWayImportWithErrorOrdinal: |
| in_ := &testprotocolpayloadsimported.ImportStructPayload{} |
| 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_ |
| } |
| payload, err_ := s_.Impl.TwoWayImportWithError(args_.Ctx, (*in_).A) |
| out_ := &payload |
| return out_, true, err_ |
| case MainProtocolOneWayAnonOrdinal: |
| in_ := &MainProtocolOneWayAnonRequest{} |
| 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_ |
| } |
| err_ := s_.Impl.OneWayAnon(args_.Ctx, (*in_).A, (*in_).B) |
| return nil, false, err_ |
| case MainProtocolTwoWayAnonOrdinal: |
| in_ := &MainProtocolTwoWayAnonRequest{} |
| 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_ |
| } |
| a, b, err_ := s_.Impl.TwoWayAnon(args_.Ctx, (*in_).A, (*in_).B) |
| out_ := &MainProtocolTwoWayAnonResponse{A: a, B: b} |
| return out_, true, err_ |
| case MainProtocolTwoWayAnonWithErrorOrdinal: |
| in_ := &MainProtocolTwoWayAnonWithErrorRequest{} |
| 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_ |
| } |
| payload, err_ := s_.Impl.TwoWayAnonWithError(args_.Ctx, (*in_).A, (*in_).B) |
| out_ := &payload |
| return out_, true, err_ |
| } |
| return nil, false, _bindings.ErrUnknownOrdinal |
| } |
| |
| type MainProtocolEventProxy _bindings.ChannelProxy |
| |
| func (p *MainProtocolEventProxy) OnComposed(a int32) error { |
| event_ := &testprotocolpayloadsimported.ImportStructPayload{A: a} |
| return ((*_bindings.ChannelProxy)(p)).Send(MainProtocolOnComposedOrdinal, event_) |
| } |
| func (p *MainProtocolEventProxy) OnLocal(a uint32, b uint32) error { |
| event_ := &LocalStructPayload{A: a, B: b} |
| return ((*_bindings.ChannelProxy)(p)).Send(MainProtocolOnLocalOrdinal, event_) |
| } |
| func (p *MainProtocolEventProxy) OnImport(a int32) error { |
| event_ := &testprotocolpayloadsimported.ImportStructPayload{A: a} |
| return ((*_bindings.ChannelProxy)(p)).Send(MainProtocolOnImportOrdinal, event_) |
| } |
| func (p *MainProtocolEventProxy) OnAnon(a uint32, b uint32) error { |
| event_ := &MainProtocolOnAnonRequest{A: a, B: b} |
| return ((*_bindings.ChannelProxy)(p)).Send(MainProtocolOnAnonOrdinal, event_) |
| } |