-
Notifications
You must be signed in to change notification settings - Fork 38
Open
Description
Problem to Solve
It's unclear to anyone consuming the c driver which non _drop functions consume the argument pointer.
Proposed Solution
It is quite obvious from the implementation of the functions in rust when the pointer is consumed (take_ownership). This can be added to the docstring.
/// Produces an <code>Iterator</code> over all JSON <code>ConceptDocument</code>s in this <code>QueryAnswer</code>.
+ Consumes the <code>QueryAnswer</code>.
#[no_mangle]
pub extern "C" fn query_answer_into_documents(query_answer: *mut QueryAnswer) -> *mut StringIterator {
release(StringIterator(CIterator(box_stream(
take_ownership(query_answer)
.into_documents()
.map(|result| result.map(|document| document.into_json().to_string())),
))))
}Metadata
Metadata
Assignees
Labels
No labels