Comments (3)
You can use Binary<u8>
as an argument for binary data. Internally it is represented (and dereferences to) a Vec<u8>
. See here for more: https://davidcole1340.github.io/ext-php-rs/types/binary.html
from ext-php-rs.
First of all, thanks for your fast response! I have checked and indeed it works as expected 👍
Last question regarding to this issue. I've been reading through the code for Binary<T>
, and it seems like it copies all the PHP memory into Rust owned memory: https://github.com/davidcole1340/ext-php-rs/blob/master/src/binary.rs#L156-L166
Would there be a way to obtain a reference to that memory without copying it? We should be able to achieve something like that by using std::slice::from_raw_parts
, which converts a *const T
and a length to an &[T]
(it probably would only make sense to use it for &[u8]
.
Probably it would make sense to implement it in another trait/struct, such as BinaryRef
.
Thanks!
from ext-php-rs.
Implemented in this PR :)
from ext-php-rs.
Related Issues (20)
- how to get all methods of a php object? HOT 1
- Database driver usecase HOT 2
- Unable to install cargo-php HOT 4
- Static property and method HOT 2
- Err: Attempted to access uninitialized class object
- Error: Failed to copy extension from target directory to extension directory
- Feature: Add ability to build PHP as a fallback when the system library is not found
- Build error on OpenSUSE ` invalid conversion between vector type '__m128i' HOT 1
- Build failure with 0.10.3 on aarch64 HOT 3
- How to exchange datetime HOT 4
- Memory corruption when running module tests
- Performance: There seems to be a runtime related overhead with using ext-php-rs extensions in PHP HOT 11
- Stub generation of optional arguments doesn't set default value to NULL
- Module and PHP versions need to match HOT 1
- Iterator from Rust
- Can't not install cargo php under winrdows HOT 1
- Slower Than C HOT 1
- Undefined symbols while building HOT 2
- How to expose PHP's memory manager in Rust? HOT 1
- Unable to install on clean Ubuntu 22.04 docker HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ext-php-rs.