Code Monkey home page Code Monkey logo

mortal_test's Introduction

背景:Rust编写的模块,编译成dll -> pyd文件后,在python程序里面调用。 Rust模块位于目录libriichi下,以下命令编译成pyd文件(即dll文件套壳在python里可调用) 编译libriichi:

cargo build -p libriichi --lib --release
cp target/release/riichi.dll libriichi/libriichi.pyd

问题描述: Rust代码中,libriichi.mjai.bot文件中 (https://github.com/latorc/mortal_test/blob/main/libriichi/src/mjai/bot.rs)

struct Bot下有一个clone方法,目的是用于深度拷贝/克隆这个对象(递归拷贝所有子对象/变量),提供一个状态完全一样的对象复制。 这个clone方法需要在python中可以调用。现在的代码,在python中调用clone()方法会导致卡住,不返回。 测试代码:test.py

需求:修改rust代码(可能需要修改其他相关的文件),给struct Bot实现一个有效的,并且可以在Python中调用的clone方法

mortal_test's People

Contributors

latorc avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.