You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2020/10/27 10:54:09 UTC

[GitHub] [arrow] alamb commented on a change in pull request #8534: ARROW-10396: [Rust] [Parquet] Publically export SliceableCursor and FileSource (DRAFT)

alamb commented on a change in pull request #8534:
URL: https://github.com/apache/arrow/pull/8534#discussion_r512590881



##########
File path: rust/parquet/src/util/cursor.rs
##########
@@ -15,20 +15,31 @@
 // specific language governing permissions and limitations
 // under the License.
 
-use std::cmp;
-use std::io::{self, Error, ErrorKind, Read};
+use std::io::{self, Error, ErrorKind, Read, Seek, SeekFrom};
 use std::rc::Rc;
+use std::{cmp, fmt};
 
 /// This is object to use if your file is already in memory.
 /// The sliceable cursor is similar to std::io::Cursor, except that it makes it easy to create "cursor slices".
 /// To achieve this, it uses Rc instead of shared references. Indeed reference fields are painfull
 /// because the lack of Generic Associated Type implies that you would require complex lifetime propagation when
 /// returning such a cursor.
 pub struct SliceableCursor {
-    inner: Rc<Vec<u8>>,
     start: u64,
     length: usize,
     pos: u64,
+    inner: Rc<Vec<u8>>,
+}
+
+impl fmt::Debug for SliceableCursor {

Review comment:
       I used this formulation rather than `[#derive(Debug)]` to avoid getting the buffer contents dumped which can be lots of data to sort through. 




----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org