We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
&[u8]
&mut [u8]
Following discussion in #2847 this issue is the MVP of zero copy buffers, with foreign owned byte arrays over synchronous calls.
The frontends already detect:
[ByRef] bytes
The foreign language bindings represent this as:
Data
ByteBuffer
bytes
For arguments in async calls, this would revert to copying semantics.
For &mut [u8], this is slightly more involved:
[ByMutRef] bytes
LiftMutRef
LiftRef
inout Data
bytearray
Without mutability, this would be more minimal, but non-viable.
Following discussion in #2847 this issue is the MVP of zero copy buffers, with foreign owned byte arrays over synchronous calls.
The frontends already detect:
[ByRef] bytesin UDL&[u8]in proc-macros.The foreign language bindings represent this as:
Datafor SwiftByteBufferfor Kotlin — this is a change in behaviour.bytesfor PythonFor arguments in async calls, this would revert to copying semantics.
For
&mut [u8], this is slightly more involved:[ByMutRef] bytesannotation in UDLLiftMutReftrait to correspond to theLiftReftrait.inout Datafor Swiftbytearrayfor PythonWithout mutability, this would be more minimal, but non-viable.