本文整理匯總了Golang中zombiezen/com/go/capnproto2.NewStruct函數的典型用法代碼示例。如果您正苦於以下問題:Golang NewStruct函數的具體用法?Golang NewStruct怎麽用?Golang NewStruct使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了NewStruct函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。
示例1: NewBook
func NewBook(s *capnp.Segment) (Book, error) {
st, err := capnp.NewStruct(s, capnp.ObjectSize{DataSize: 8, PointerCount: 1})
if err != nil {
return Book{}, err
}
return Book{st}, nil
}
示例2: NewHashFactory_newSha1_Results
func NewHashFactory_newSha1_Results(s *capnp.Segment) (HashFactory_newSha1_Results, error) {
st, err := capnp.NewStruct(s, capnp.ObjectSize{DataSize: 0, PointerCount: 1})
if err != nil {
return HashFactory_newSha1_Results{}, err
}
return HashFactory_newSha1_Results{st}, nil
}
示例3: NewAiConnector_connect_Results
func NewAiConnector_connect_Results(s *capnp.Segment) (AiConnector_connect_Results, error) {
st, err := capnp.NewStruct(s, capnp.ObjectSize{DataSize: 0, PointerCount: 0})
if err != nil {
return AiConnector_connect_Results{}, err
}
return AiConnector_connect_Results{st}, nil
}
示例4: NewReplay_Round
func NewReplay_Round(s *capnp.Segment) (Replay_Round, error) {
st, err := capnp.NewStruct(s, capnp.ObjectSize{DataSize: 0, PointerCount: 2})
if err != nil {
return Replay_Round{}, err
}
return Replay_Round{st}, nil
}
示例5: NewRobot
func NewRobot(s *capnp.Segment) (Robot, error) {
st, err := capnp.NewStruct(s, capnp.ObjectSize{DataSize: 16, PointerCount: 0})
if err != nil {
return Robot{}, err
}
return Robot{st}, nil
}
示例6: NewAi_takeTurn_Params
func NewAi_takeTurn_Params(s *capnp.Segment) (Ai_takeTurn_Params, error) {
st, err := capnp.NewStruct(s, capnp.ObjectSize{DataSize: 0, PointerCount: 1})
if err != nil {
return Ai_takeTurn_Params{}, err
}
return Ai_takeTurn_Params{st}, nil
}
示例7: NewCredentials
func NewCredentials(s *capnp.Segment) (Credentials, error) {
st, err := capnp.NewStruct(s, capnp.ObjectSize{DataSize: 0, PointerCount: 1})
if err != nil {
return Credentials{}, err
}
return Credentials{st}, nil
}
示例8: NewCapnp2A
func NewCapnp2A(s *capnp.Segment) (Capnp2A, error) {
st, err := capnp.NewStruct(s, capnp.ObjectSize{DataSize: 24, PointerCount: 2})
if err != nil {
return Capnp2A{}, err
}
return Capnp2A{st}, nil
}
示例9: NewAdder_add_Results
func NewAdder_add_Results(s *capnp.Segment) (Adder_add_Results, error) {
st, err := capnp.NewStruct(s, capnp.ObjectSize{DataSize: 8, PointerCount: 0})
if err != nil {
return Adder_add_Results{}, err
}
return Adder_add_Results{st}, nil
}
示例10: NewTurn
func NewTurn(s *capnp.Segment) (Turn, error) {
st, err := capnp.NewStruct(s, capnp.ObjectSize{DataSize: 8, PointerCount: 0})
if err != nil {
return Turn{}, err
}
return Turn{st}, nil
}
示例11: NewHanger_hang_Results
func NewHanger_hang_Results(s *capnp.Segment) (Hanger_hang_Results, error) {
st, err := capnp.NewStruct(s, capnp.ObjectSize{DataSize: 0, PointerCount: 0})
if err != nil {
return Hanger_hang_Results{}, err
}
return Hanger_hang_Results{st}, nil
}
示例12: NewHandleFactory_newHandle_Params
func NewHandleFactory_newHandle_Params(s *capnp.Segment) (HandleFactory_newHandle_Params, error) {
st, err := capnp.NewStruct(s, capnp.ObjectSize{DataSize: 0, PointerCount: 0})
if err != nil {
return HandleFactory_newHandle_Params{}, err
}
return HandleFactory_newHandle_Params{st}, nil
}
示例13: NewConnectRequest
func NewConnectRequest(s *capnp.Segment) (ConnectRequest, error) {
st, err := capnp.NewStruct(s, capnp.ObjectSize{DataSize: 0, PointerCount: 2})
if err != nil {
return ConnectRequest{}, err
}
return ConnectRequest{st}, nil
}
示例14: NewCallOrder_getCallSequence_Results
func NewCallOrder_getCallSequence_Results(s *capnp.Segment) (CallOrder_getCallSequence_Results, error) {
st, err := capnp.NewStruct(s, capnp.ObjectSize{DataSize: 8, PointerCount: 0})
if err != nil {
return CallOrder_getCallSequence_Results{}, err
}
return CallOrder_getCallSequence_Results{st}, nil
}
示例15: NewEchoer_echo_Results
func NewEchoer_echo_Results(s *capnp.Segment) (Echoer_echo_Results, error) {
st, err := capnp.NewStruct(s, capnp.ObjectSize{DataSize: 0, PointerCount: 1})
if err != nil {
return Echoer_echo_Results{}, err
}
return Echoer_echo_Results{st}, nil
}