本文整理匯總了Golang中github.com/gemrs/gem/pybind.Wrap函數的典型用法代碼示例。如果您正苦於以下問題:Golang Wrap函數的具體用法?Golang Wrap怎麽用?Golang Wrap使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了Wrap函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。
示例1: PySet_appearance
func (client *Player) PySet_appearance(value py.Object) error {
fn := pybind.Wrap(client.SetAppearance)
args, err := py.PackTuple(value)
if err != nil {
return err
}
_, err = fn(args, nil)
return err
}
示例2: Py_deserialize
func (p *Profile) Py_deserialize(args *py.Tuple, kwds *py.Dict) (py.Object, error) {
fn := pybind.Wrap(func(obj string) {
err := p.UnmarshalJSON([]byte(obj))
if err != nil {
panic(err)
}
})
return fn(args, nil)
}
示例3: PyGet_ctx
func (m *PyModule) PyGet_ctx() (py.Object, error) {
fn := pybind.Wrap(func() py.Object {
if ctx, ok := m.Module.Ctx().(*PyContext); ok {
return ctx
}
py.None.Incref()
return py.None
})
return fn(nil, nil)
}
示例4: Py_serialize
func (p *Profile) Py_serialize(args *py.Tuple, kwds *py.Dict) (py.Object, error) {
fn := pybind.Wrap(func() string {
obj, err := json.Marshal(p)
if err != nil {
panic(err)
}
return string(obj)
})
return fn(args, nil)
}
示例5: Py_local_to
func (pos *Absolute) Py_local_to(args *py.Tuple, kwds *py.Dict) (py.Object, error) {
fn := pybind.Wrap(pos.LocalTo)
return fn(args, kwds)
}
示例6: PyGet_region
func (pos *Absolute) PyGet_region() (py.Object, error) {
fn := pybind.Wrap(pos.RegionOf)
return fn(nil, nil)
}
示例7: PyGet_removing
func (c *Collection) PyGet_removing() (py.Object, error) {
fn := pybind.Wrap(c.Removing)
return fn(nil, nil)
}
示例8: PyGet_log
func (c *Connection) PyGet_log() (py.Object, error) {
fn := pybind.Wrap(c.Log)
return fn(nil, nil)
}
示例9: Py_add
func (s *Slice) Py_add(args *py.Tuple, kwds *py.Dict) (py.Object, error) {
fn := pybind.Wrap(s.Add)
return fn(args, kwds)
}
示例10: Py_rebase
func (region *Region) Py_rebase(args *py.Tuple, kwds *py.Dict) (py.Object, error) {
fn := pybind.Wrap(region.Rebase)
return fn(args, kwds)
}
示例11: Py_add_all
func (l *List) Py_add_all(args *py.Tuple, kwds *py.Dict) (py.Object, error) {
fn := pybind.Wrap(l.AddAll)
return fn(args, kwds)
}
示例12: Py_remove_all
func (l *List) Py_remove_all(args *py.Tuple, kwds *py.Dict) (py.Object, error) {
fn := pybind.Wrap(l.RemoveAll)
return fn(args, kwds)
}
示例13: PyGet_size
func (s *Slice) PyGet_size() (py.Object, error) {
fn := pybind.Wrap(s.Size)
return fn(nil, nil)
}
示例14: Py_filter
func (s *Slice) Py_filter(args *py.Tuple, kwds *py.Dict) (py.Object, error) {
fn := pybind.Wrap(s.Filter)
return fn(args, kwds)
}
示例15: Py_empty
func (s *Slice) Py_empty(args *py.Tuple, kwds *py.Dict) (py.Object, error) {
fn := pybind.Wrap(s.Empty)
return fn(args, kwds)
}