wjones127 commented on code in PR #4232:
URL: https://github.com/apache/arrow-rs/pull/4232#discussion_r1201344255


##########
arrow/src/ffi_stream.rs:
##########
@@ -37,25 +37,19 @@
 //! let reader = Box::new(FileReader::try_new(file).unwrap());
 //!
 //! // export it
-//! let stream = Box::new(FFI_ArrowArrayStream::empty());
-//! let stream_ptr = Box::into_raw(stream) as *mut FFI_ArrowArrayStream;
-//! unsafe { export_reader_into_raw(reader, stream_ptr) };
+//! let mut stream = FFI_ArrowArrayStream::empty();
+//! unsafe { export_reader_into_raw(reader, &mut stream) };
 //!
 //! // consumed and used by something else...
 //!
 //! // import it
-//! let stream_reader = unsafe { 
ArrowArrayStreamReader::from_raw(stream_ptr).unwrap() };
+//! let stream_reader = unsafe { ArrowArrayStreamReader::from_raw(&mut 
stream).unwrap() };

Review Comment:
   I think it's still relevant. For example, there are cases where we need to 
implement a C API where we will be passed a pointer to an 
ArrowArrayStreamReader. For example, this is done in the "bind stream" function 
in ADBC:
   
   
https://github.com/apache/arrow-adbc/blob/75ba2cef9080b19f4d242d0a03c17db304609d85/rust/src/implement/internal.rs#L647-L664



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to