cstrptr-rs's People
Forkers
metawormcstrptr-rs's Issues
cstr! does not check for interior nul
Is this unsound or simply erroneous? It at least seems very unlikely to happen by accident.
Fix this by turning it into a proc macro, or if recursive const fn/generics ever become a thing that could work too.
CStr::from_ptr length too short by one
Lines 30 to 33 in bdc51fc
this should probably be:
Self::from_bytes_with_nul_unchecked(core::slice::from_raw_parts(ptr as *const _, len + 1))
A future where &CStr is fixed
This library intends to paper over the undefined representation of CStr
by offering both versions and guaranteeing their performance/storage characteristics. It also re-exports std
types when that feature is used. If &CStr
is ever fixed to be a single pointer (and thus becomes equivalent to CStrPtr
) then the types this crate exports for std
need to accommodate that by re-exporting std::ffi::CStr as CStrPtr
. It would then offer a custom &CStr
pointer implementing the old behaviour.
rustversion would be good to use when the time comes? However, consider that CStrPtr
doesn't currently exist due to custom DSTs not being usable, which means that offering &CStrPtr
instead of CStrPtr<'_>
will require a newer rustc
anyway. I suppose a third type name will need to be decided on?
&FatCStr
&CStr
CStrPtr
This naming change could (and maybe should) happen sooner rather than later, then simply do not have &CStr
until there's a good way to create it. See also prior art using extern { type c_char; }
, and the rustc tracking issue.
std::ffi deviations
Track and fix any API differences for including missing types, functions, etc.
-
std::ffi::NulError
(and probably other error types?) - lots more!
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.