szaszm commented on code in PR #2186:
URL: https://github.com/apache/nifi-minifi-cpp/pull/2186#discussion_r3644723649


##########
minifi_rust/minifi_native/src/c_ffi/c_ffi_streams.rs:
##########
@@ -0,0 +1,143 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   https://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+use minifi_native_sys::{
+    minifi_input_stream, minifi_input_stream_read, minifi_output_stream, 
minifi_output_stream_write,
+};
+use std::io::{BufRead, Error, Read};
+
+#[derive(Debug)]
+pub struct CffiInputStream<'a> {
+    ptr: *mut minifi_input_stream,
+    buffer: [u8; 8192],
+    pos: usize,
+    cap: usize,

Review Comment:
   yeah, filled is a better name. I'm wondering why is there a buffer in the 
InputStream? I'm guessing cap/filled means that the [0;filled) range is 
valid/used in the buffer, and pos < cap. Is that correct?



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