Commit graph

14 commits

Author SHA1 Message Date
Emily Toop
0e0316991a Crash on null pointer inside destroy functions. 2018-05-14 14:17:25 +01:00
Emily Toop
c2dbf2c304 Return &str from c_char_to_string rather than String to avoid unnecessary allocations. 2018-05-14 12:35:45 +01:00
Emily Toop
31556023e5 Update consuming FFI function names to better reflect consuming nature (as -> to). 2018-05-14 12:34:29 +01:00
Emily Toop
f38f27f848 Address documentation nits. 2018-05-14 12:30:53 +01:00
Emily Toop
5b52e2115f Replace references to sql with query 2018-05-14 12:27:50 +01:00
Emily Toop
515300e521 Add documentation for Rust FFI and Swift C Header 2018-05-14 12:27:50 +01:00
Emily Toop
0c758ab6d3 don't use as many strings when panicking on unwrapping typed values
link to fixtures directory rather than copying fixtures files

Remove logs, boilerplate comments and unused code.
2018-05-14 12:25:21 +01:00
Emily Toop
bda1ec4d0a Add simple transact string to FFI.
Rename ExternTxReport and ExternTxReportList to distinguish between TxReport from transact and the results of a transaction observer firing.

Move to use c_longlong instead of i64 and time_t as Android and iOS provide different sizes.

Use to_string instead of description for errors as they are more descriptive.

Pass UUID values as bytes rather than strings

Remove unused FFI functions (functionality has been removed)

Handle optional results better - return null if optional is None

Return boolean as integer value rather than bool as Swift can't handle them.

When returning values from an iterator, make sure we don't release the value at the end of the Rust function leaving a dangling pointer.
2018-05-14 11:53:49 +01:00
Richard Newman
3dc68bcd38 Combine NamespacedKeyword and Keyword. (#689) r=nalexander
* Make properties on NamespacedKeyword/NamespacedSymbol private

* Use only a single String for NamespacedKeyword/NamespacedSymbol

* Review comments.

* Remove unsafe code in namespaced_name.

Benchmarking shows approximately zero change.

* Allow the types of ns and name to differ when constructing a NamespacedName.

* Make symbol namespaces optional.

* Normalize names of keyword/symbol constructors.

This will make the subsequent refactor much less painful.

* Use expect not unwrap.

* Merge Keyword and NamespacedKeyword.
2018-05-11 09:52:17 -07:00
Richard Newman
f979044ba1
Refactor value type boxing. (#659) r=nalexander
* Pre: eliminate some occurrences of Rc, largely through the magic of Into.
* Pre: introduce FromRc to convert between refcounted types.
* Introduce ValueRc as an abstraction over Rc/Arc choice.
* Move Cloned to core.
* Move CString-creation methods to TypedValue.
* Finish transition.
2018-04-25 14:23:27 -07:00
Emily Toop
175958e754 Address review comments @rnewman 2018-04-06 10:46:15 +01:00
Emily Toop
19ddf9c384 Spacing 2018-04-06 10:46:15 +01:00
Emily Toop
fa7dd2ceab Add FFI for query building 2018-04-06 10:46:15 +01:00
Emily Toop
9f30fe6295 Create Mentat FFI and expose observers (#574)
* Tidy up and add txid at beginning of transaction

* Add ffi crate and new_store function

* Add register and unregister observer FFI, Store and Conn functions.
Also add android logging facilities

* Add function for fetching entids for attribute strings

* Add functions for iterating through TxReports

* Add sync to ffi boundary

* Move Extern types from submodule to lib in FFI.
For some reason, if these types are in a submodule, even if they are publically used, the functions inside the FFI are not found in
Android. Works for iOS though. To be investigated later....

* Return to passing TxReports to observer function.
Also, remove some debug

* Expose DateTime and Utc publically

* Use Store in observer tests
2018-03-20 19:16:32 +00:00