Skip to content

Commit

Permalink
refactor: upgrade to v0.10.0: add Query and remove GetFilter, a…
Browse files Browse the repository at this point in the history
…nd other api adjustments (#68)
  • Loading branch information
ramfox authored Nov 9, 2023
1 parent 2774c39 commit d602b65
Show file tree
Hide file tree
Showing 14 changed files with 1,675 additions and 1,111 deletions.
622 changes: 321 additions & 301 deletions Cargo.lock

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "iroh-ffi"
version = "0.2.0"
version = "0.10.0"
edition = "2021"
publish = false
readme = "README.md"
Expand Down Expand Up @@ -30,11 +30,11 @@ anyhow = "1.0.69"
blake3 = "1.3.3"
bytes = "1"
data-encoding = { version = "2.3.3" }
iroh = { version = "0.9.0", default-features = false, features = [
iroh = { version = "0.10.0", default-features = false, features = [
"flat-db",
"metrics",
] }
iroh-io = { version = "0.2.1" }
iroh-io = { version = "0.3.0" }
libc = "0.2.141"
multibase = { version = "0.9.1" }
num_cpus = { version = "1.15.0" }
Expand Down
88 changes: 46 additions & 42 deletions Iroh.xcframework/ios-arm64/Iroh.framework/Headers/irohFFI.h
Original file line number Diff line number Diff line change
Expand Up @@ -98,9 +98,9 @@ void uniffi_iroh_fn_method_doc_close(void*_Nonnull ptr, RustCallStatus *_Nonnull
);
uint64_t uniffi_iroh_fn_method_doc_del(void*_Nonnull ptr, void*_Nonnull author_id, RustBuffer prefix, RustCallStatus *_Nonnull out_status
);
RustBuffer uniffi_iroh_fn_method_doc_get_many(void*_Nonnull ptr, void*_Nonnull filter, RustCallStatus *_Nonnull out_status
RustBuffer uniffi_iroh_fn_method_doc_get_many(void*_Nonnull ptr, void*_Nonnull query, RustCallStatus *_Nonnull out_status
);
RustBuffer uniffi_iroh_fn_method_doc_get_one(void*_Nonnull ptr, void*_Nonnull author_id, RustBuffer key, RustCallStatus *_Nonnull out_status
RustBuffer uniffi_iroh_fn_method_doc_get_one(void*_Nonnull ptr, void*_Nonnull query, RustCallStatus *_Nonnull out_status
);
void*_Nonnull uniffi_iroh_fn_method_doc_id(void*_Nonnull ptr, RustCallStatus *_Nonnull out_status
);
Expand Down Expand Up @@ -138,21 +138,6 @@ RustBuffer uniffi_iroh_fn_method_entry_key(void*_Nonnull ptr, RustCallStatus *_N
);
void*_Nonnull uniffi_iroh_fn_method_entry_namespace(void*_Nonnull ptr, RustCallStatus *_Nonnull out_status
);
void uniffi_iroh_fn_free_getfilter(void*_Nonnull ptr, RustCallStatus *_Nonnull out_status
);
void*_Nonnull uniffi_iroh_fn_constructor_getfilter_all(RustCallStatus *_Nonnull out_status

);
void*_Nonnull uniffi_iroh_fn_constructor_getfilter_author(void*_Nonnull author, RustCallStatus *_Nonnull out_status
);
void*_Nonnull uniffi_iroh_fn_constructor_getfilter_author_prefix(void*_Nonnull author, RustBuffer prefix, RustCallStatus *_Nonnull out_status
);
void*_Nonnull uniffi_iroh_fn_constructor_getfilter_key(RustBuffer key, RustCallStatus *_Nonnull out_status
);
void*_Nonnull uniffi_iroh_fn_constructor_getfilter_prefix(RustBuffer prefix, RustCallStatus *_Nonnull out_status
);
int8_t uniffi_iroh_fn_method_getfilter_equal(void*_Nonnull ptr, void*_Nonnull other, RustCallStatus *_Nonnull out_status
);
void uniffi_iroh_fn_free_hash(void*_Nonnull ptr, RustCallStatus *_Nonnull out_status
);
RustBuffer uniffi_iroh_fn_method_hash_to_bytes(void*_Nonnull ptr, RustCallStatus *_Nonnull out_status
Expand Down Expand Up @@ -233,15 +218,15 @@ int8_t uniffi_iroh_fn_method_namespaceid_equal(void*_Nonnull ptr, void*_Nonnull
);
RustBuffer uniffi_iroh_fn_method_namespaceid_to_string(void*_Nonnull ptr, RustCallStatus *_Nonnull out_status
);
void uniffi_iroh_fn_free_peeraddr(void*_Nonnull ptr, RustCallStatus *_Nonnull out_status
void uniffi_iroh_fn_free_nodeaddr(void*_Nonnull ptr, RustCallStatus *_Nonnull out_status
);
void*_Nonnull uniffi_iroh_fn_constructor_peeraddr_new(void*_Nonnull node_id, RustBuffer region_id, RustBuffer addresses, RustCallStatus *_Nonnull out_status
void*_Nonnull uniffi_iroh_fn_constructor_nodeaddr_new(void*_Nonnull node_id, RustBuffer region_id, RustBuffer addresses, RustCallStatus *_Nonnull out_status
);
RustBuffer uniffi_iroh_fn_method_peeraddr_derp_region(void*_Nonnull ptr, RustCallStatus *_Nonnull out_status
RustBuffer uniffi_iroh_fn_method_nodeaddr_derp_region(void*_Nonnull ptr, RustCallStatus *_Nonnull out_status
);
RustBuffer uniffi_iroh_fn_method_peeraddr_direct_addresses(void*_Nonnull ptr, RustCallStatus *_Nonnull out_status
RustBuffer uniffi_iroh_fn_method_nodeaddr_direct_addresses(void*_Nonnull ptr, RustCallStatus *_Nonnull out_status
);
int8_t uniffi_iroh_fn_method_peeraddr_equal(void*_Nonnull ptr, void*_Nonnull other, RustCallStatus *_Nonnull out_status
int8_t uniffi_iroh_fn_method_nodeaddr_equal(void*_Nonnull ptr, void*_Nonnull other, RustCallStatus *_Nonnull out_status
);
void uniffi_iroh_fn_free_publickey(void*_Nonnull ptr, RustCallStatus *_Nonnull out_status
);
Expand All @@ -257,6 +242,22 @@ RustBuffer uniffi_iroh_fn_method_publickey_to_bytes(void*_Nonnull ptr, RustCallS
);
RustBuffer uniffi_iroh_fn_method_publickey_to_string(void*_Nonnull ptr, RustCallStatus *_Nonnull out_status
);
void uniffi_iroh_fn_free_query(void*_Nonnull ptr, RustCallStatus *_Nonnull out_status
);
void*_Nonnull uniffi_iroh_fn_constructor_query_all(RustBuffer sort_by, RustBuffer direction, RustBuffer offset, RustBuffer limit, RustCallStatus *_Nonnull out_status
);
void*_Nonnull uniffi_iroh_fn_constructor_query_author(void*_Nonnull author, RustBuffer sort_by, RustBuffer direction, RustBuffer offset, RustBuffer limit, RustCallStatus *_Nonnull out_status
);
void*_Nonnull uniffi_iroh_fn_constructor_query_key_exact(RustBuffer key, RustBuffer sort_by, RustBuffer direction, RustBuffer offset, RustBuffer limit, RustCallStatus *_Nonnull out_status
);
void*_Nonnull uniffi_iroh_fn_constructor_query_key_prefix(RustBuffer prefix, RustBuffer sort_by, RustBuffer direction, RustBuffer offset, RustBuffer limit, RustCallStatus *_Nonnull out_status
);
void*_Nonnull uniffi_iroh_fn_constructor_query_single_latest_per_key(RustBuffer direction, RustBuffer offset, RustBuffer limit, RustCallStatus *_Nonnull out_status
);
RustBuffer uniffi_iroh_fn_method_query_limit(void*_Nonnull ptr, RustCallStatus *_Nonnull out_status
);
uint64_t uniffi_iroh_fn_method_query_offset(void*_Nonnull ptr, RustCallStatus *_Nonnull out_status
);
void uniffi_iroh_fn_free_socketaddr(void*_Nonnull ptr, RustCallStatus *_Nonnull out_status
);
void*_Nonnull uniffi_iroh_fn_constructor_socketaddr_from_ipv4(void*_Nonnull ipv4, uint16_t port, RustCallStatus *_Nonnull out_status
Expand Down Expand Up @@ -382,9 +383,6 @@ uint16_t uniffi_iroh_checksum_method_entry_key(void
);
uint16_t uniffi_iroh_checksum_method_entry_namespace(void

);
uint16_t uniffi_iroh_checksum_method_getfilter_equal(void

);
uint16_t uniffi_iroh_checksum_method_hash_to_bytes(void

Expand Down Expand Up @@ -470,13 +468,13 @@ uint16_t uniffi_iroh_checksum_method_namespaceid_equal(void
uint16_t uniffi_iroh_checksum_method_namespaceid_to_string(void

);
uint16_t uniffi_iroh_checksum_method_peeraddr_derp_region(void
uint16_t uniffi_iroh_checksum_method_nodeaddr_derp_region(void

);
uint16_t uniffi_iroh_checksum_method_peeraddr_direct_addresses(void
uint16_t uniffi_iroh_checksum_method_nodeaddr_direct_addresses(void

);
uint16_t uniffi_iroh_checksum_method_peeraddr_equal(void
uint16_t uniffi_iroh_checksum_method_nodeaddr_equal(void

);
uint16_t uniffi_iroh_checksum_method_publickey_equal(void
Expand All @@ -490,6 +488,12 @@ uint16_t uniffi_iroh_checksum_method_publickey_to_bytes(void
);
uint16_t uniffi_iroh_checksum_method_publickey_to_string(void

);
uint16_t uniffi_iroh_checksum_method_query_limit(void

);
uint16_t uniffi_iroh_checksum_method_query_offset(void

);
uint16_t uniffi_iroh_checksum_method_socketaddr_as_ipv4(void

Expand Down Expand Up @@ -533,46 +537,46 @@ uint16_t uniffi_iroh_checksum_constructor_authorid_from_string(void
uint16_t uniffi_iroh_checksum_constructor_docticket_from_string(void

);
uint16_t uniffi_iroh_checksum_constructor_getfilter_all(void
uint16_t uniffi_iroh_checksum_constructor_ipv4addr_from_string(void

);
uint16_t uniffi_iroh_checksum_constructor_getfilter_author(void
uint16_t uniffi_iroh_checksum_constructor_ipv4addr_new(void

);
uint16_t uniffi_iroh_checksum_constructor_getfilter_author_prefix(void
uint16_t uniffi_iroh_checksum_constructor_ipv6addr_from_string(void

);
uint16_t uniffi_iroh_checksum_constructor_getfilter_key(void
uint16_t uniffi_iroh_checksum_constructor_ipv6addr_new(void

);
uint16_t uniffi_iroh_checksum_constructor_getfilter_prefix(void
uint16_t uniffi_iroh_checksum_constructor_irohnode_new(void

);
uint16_t uniffi_iroh_checksum_constructor_ipv4addr_from_string(void
uint16_t uniffi_iroh_checksum_constructor_namespaceid_from_string(void

);
uint16_t uniffi_iroh_checksum_constructor_ipv4addr_new(void
uint16_t uniffi_iroh_checksum_constructor_nodeaddr_new(void

);
uint16_t uniffi_iroh_checksum_constructor_ipv6addr_from_string(void
uint16_t uniffi_iroh_checksum_constructor_publickey_from_bytes(void

);
uint16_t uniffi_iroh_checksum_constructor_ipv6addr_new(void
uint16_t uniffi_iroh_checksum_constructor_publickey_from_string(void

);
uint16_t uniffi_iroh_checksum_constructor_irohnode_new(void
uint16_t uniffi_iroh_checksum_constructor_query_all(void

);
uint16_t uniffi_iroh_checksum_constructor_namespaceid_from_string(void
uint16_t uniffi_iroh_checksum_constructor_query_author(void

);
uint16_t uniffi_iroh_checksum_constructor_peeraddr_new(void
uint16_t uniffi_iroh_checksum_constructor_query_key_exact(void

);
uint16_t uniffi_iroh_checksum_constructor_publickey_from_bytes(void
uint16_t uniffi_iroh_checksum_constructor_query_key_prefix(void

);
uint16_t uniffi_iroh_checksum_constructor_publickey_from_string(void
uint16_t uniffi_iroh_checksum_constructor_query_single_latest_per_key(void

);
uint16_t uniffi_iroh_checksum_constructor_socketaddr_from_ipv4(void
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,9 +98,9 @@ void uniffi_iroh_fn_method_doc_close(void*_Nonnull ptr, RustCallStatus *_Nonnull
);
uint64_t uniffi_iroh_fn_method_doc_del(void*_Nonnull ptr, void*_Nonnull author_id, RustBuffer prefix, RustCallStatus *_Nonnull out_status
);
RustBuffer uniffi_iroh_fn_method_doc_get_many(void*_Nonnull ptr, void*_Nonnull filter, RustCallStatus *_Nonnull out_status
RustBuffer uniffi_iroh_fn_method_doc_get_many(void*_Nonnull ptr, void*_Nonnull query, RustCallStatus *_Nonnull out_status
);
RustBuffer uniffi_iroh_fn_method_doc_get_one(void*_Nonnull ptr, void*_Nonnull author_id, RustBuffer key, RustCallStatus *_Nonnull out_status
RustBuffer uniffi_iroh_fn_method_doc_get_one(void*_Nonnull ptr, void*_Nonnull query, RustCallStatus *_Nonnull out_status
);
void*_Nonnull uniffi_iroh_fn_method_doc_id(void*_Nonnull ptr, RustCallStatus *_Nonnull out_status
);
Expand Down Expand Up @@ -138,21 +138,6 @@ RustBuffer uniffi_iroh_fn_method_entry_key(void*_Nonnull ptr, RustCallStatus *_N
);
void*_Nonnull uniffi_iroh_fn_method_entry_namespace(void*_Nonnull ptr, RustCallStatus *_Nonnull out_status
);
void uniffi_iroh_fn_free_getfilter(void*_Nonnull ptr, RustCallStatus *_Nonnull out_status
);
void*_Nonnull uniffi_iroh_fn_constructor_getfilter_all(RustCallStatus *_Nonnull out_status

);
void*_Nonnull uniffi_iroh_fn_constructor_getfilter_author(void*_Nonnull author, RustCallStatus *_Nonnull out_status
);
void*_Nonnull uniffi_iroh_fn_constructor_getfilter_author_prefix(void*_Nonnull author, RustBuffer prefix, RustCallStatus *_Nonnull out_status
);
void*_Nonnull uniffi_iroh_fn_constructor_getfilter_key(RustBuffer key, RustCallStatus *_Nonnull out_status
);
void*_Nonnull uniffi_iroh_fn_constructor_getfilter_prefix(RustBuffer prefix, RustCallStatus *_Nonnull out_status
);
int8_t uniffi_iroh_fn_method_getfilter_equal(void*_Nonnull ptr, void*_Nonnull other, RustCallStatus *_Nonnull out_status
);
void uniffi_iroh_fn_free_hash(void*_Nonnull ptr, RustCallStatus *_Nonnull out_status
);
RustBuffer uniffi_iroh_fn_method_hash_to_bytes(void*_Nonnull ptr, RustCallStatus *_Nonnull out_status
Expand Down Expand Up @@ -233,15 +218,15 @@ int8_t uniffi_iroh_fn_method_namespaceid_equal(void*_Nonnull ptr, void*_Nonnull
);
RustBuffer uniffi_iroh_fn_method_namespaceid_to_string(void*_Nonnull ptr, RustCallStatus *_Nonnull out_status
);
void uniffi_iroh_fn_free_peeraddr(void*_Nonnull ptr, RustCallStatus *_Nonnull out_status
void uniffi_iroh_fn_free_nodeaddr(void*_Nonnull ptr, RustCallStatus *_Nonnull out_status
);
void*_Nonnull uniffi_iroh_fn_constructor_peeraddr_new(void*_Nonnull node_id, RustBuffer region_id, RustBuffer addresses, RustCallStatus *_Nonnull out_status
void*_Nonnull uniffi_iroh_fn_constructor_nodeaddr_new(void*_Nonnull node_id, RustBuffer region_id, RustBuffer addresses, RustCallStatus *_Nonnull out_status
);
RustBuffer uniffi_iroh_fn_method_peeraddr_derp_region(void*_Nonnull ptr, RustCallStatus *_Nonnull out_status
RustBuffer uniffi_iroh_fn_method_nodeaddr_derp_region(void*_Nonnull ptr, RustCallStatus *_Nonnull out_status
);
RustBuffer uniffi_iroh_fn_method_peeraddr_direct_addresses(void*_Nonnull ptr, RustCallStatus *_Nonnull out_status
RustBuffer uniffi_iroh_fn_method_nodeaddr_direct_addresses(void*_Nonnull ptr, RustCallStatus *_Nonnull out_status
);
int8_t uniffi_iroh_fn_method_peeraddr_equal(void*_Nonnull ptr, void*_Nonnull other, RustCallStatus *_Nonnull out_status
int8_t uniffi_iroh_fn_method_nodeaddr_equal(void*_Nonnull ptr, void*_Nonnull other, RustCallStatus *_Nonnull out_status
);
void uniffi_iroh_fn_free_publickey(void*_Nonnull ptr, RustCallStatus *_Nonnull out_status
);
Expand All @@ -257,6 +242,22 @@ RustBuffer uniffi_iroh_fn_method_publickey_to_bytes(void*_Nonnull ptr, RustCallS
);
RustBuffer uniffi_iroh_fn_method_publickey_to_string(void*_Nonnull ptr, RustCallStatus *_Nonnull out_status
);
void uniffi_iroh_fn_free_query(void*_Nonnull ptr, RustCallStatus *_Nonnull out_status
);
void*_Nonnull uniffi_iroh_fn_constructor_query_all(RustBuffer sort_by, RustBuffer direction, RustBuffer offset, RustBuffer limit, RustCallStatus *_Nonnull out_status
);
void*_Nonnull uniffi_iroh_fn_constructor_query_author(void*_Nonnull author, RustBuffer sort_by, RustBuffer direction, RustBuffer offset, RustBuffer limit, RustCallStatus *_Nonnull out_status
);
void*_Nonnull uniffi_iroh_fn_constructor_query_key_exact(RustBuffer key, RustBuffer sort_by, RustBuffer direction, RustBuffer offset, RustBuffer limit, RustCallStatus *_Nonnull out_status
);
void*_Nonnull uniffi_iroh_fn_constructor_query_key_prefix(RustBuffer prefix, RustBuffer sort_by, RustBuffer direction, RustBuffer offset, RustBuffer limit, RustCallStatus *_Nonnull out_status
);
void*_Nonnull uniffi_iroh_fn_constructor_query_single_latest_per_key(RustBuffer direction, RustBuffer offset, RustBuffer limit, RustCallStatus *_Nonnull out_status
);
RustBuffer uniffi_iroh_fn_method_query_limit(void*_Nonnull ptr, RustCallStatus *_Nonnull out_status
);
uint64_t uniffi_iroh_fn_method_query_offset(void*_Nonnull ptr, RustCallStatus *_Nonnull out_status
);
void uniffi_iroh_fn_free_socketaddr(void*_Nonnull ptr, RustCallStatus *_Nonnull out_status
);
void*_Nonnull uniffi_iroh_fn_constructor_socketaddr_from_ipv4(void*_Nonnull ipv4, uint16_t port, RustCallStatus *_Nonnull out_status
Expand Down Expand Up @@ -382,9 +383,6 @@ uint16_t uniffi_iroh_checksum_method_entry_key(void
);
uint16_t uniffi_iroh_checksum_method_entry_namespace(void

);
uint16_t uniffi_iroh_checksum_method_getfilter_equal(void

);
uint16_t uniffi_iroh_checksum_method_hash_to_bytes(void

Expand Down Expand Up @@ -470,13 +468,13 @@ uint16_t uniffi_iroh_checksum_method_namespaceid_equal(void
uint16_t uniffi_iroh_checksum_method_namespaceid_to_string(void

);
uint16_t uniffi_iroh_checksum_method_peeraddr_derp_region(void
uint16_t uniffi_iroh_checksum_method_nodeaddr_derp_region(void

);
uint16_t uniffi_iroh_checksum_method_peeraddr_direct_addresses(void
uint16_t uniffi_iroh_checksum_method_nodeaddr_direct_addresses(void

);
uint16_t uniffi_iroh_checksum_method_peeraddr_equal(void
uint16_t uniffi_iroh_checksum_method_nodeaddr_equal(void

);
uint16_t uniffi_iroh_checksum_method_publickey_equal(void
Expand All @@ -490,6 +488,12 @@ uint16_t uniffi_iroh_checksum_method_publickey_to_bytes(void
);
uint16_t uniffi_iroh_checksum_method_publickey_to_string(void

);
uint16_t uniffi_iroh_checksum_method_query_limit(void

);
uint16_t uniffi_iroh_checksum_method_query_offset(void

);
uint16_t uniffi_iroh_checksum_method_socketaddr_as_ipv4(void

Expand Down Expand Up @@ -533,46 +537,46 @@ uint16_t uniffi_iroh_checksum_constructor_authorid_from_string(void
uint16_t uniffi_iroh_checksum_constructor_docticket_from_string(void

);
uint16_t uniffi_iroh_checksum_constructor_getfilter_all(void
uint16_t uniffi_iroh_checksum_constructor_ipv4addr_from_string(void

);
uint16_t uniffi_iroh_checksum_constructor_getfilter_author(void
uint16_t uniffi_iroh_checksum_constructor_ipv4addr_new(void

);
uint16_t uniffi_iroh_checksum_constructor_getfilter_author_prefix(void
uint16_t uniffi_iroh_checksum_constructor_ipv6addr_from_string(void

);
uint16_t uniffi_iroh_checksum_constructor_getfilter_key(void
uint16_t uniffi_iroh_checksum_constructor_ipv6addr_new(void

);
uint16_t uniffi_iroh_checksum_constructor_getfilter_prefix(void
uint16_t uniffi_iroh_checksum_constructor_irohnode_new(void

);
uint16_t uniffi_iroh_checksum_constructor_ipv4addr_from_string(void
uint16_t uniffi_iroh_checksum_constructor_namespaceid_from_string(void

);
uint16_t uniffi_iroh_checksum_constructor_ipv4addr_new(void
uint16_t uniffi_iroh_checksum_constructor_nodeaddr_new(void

);
uint16_t uniffi_iroh_checksum_constructor_ipv6addr_from_string(void
uint16_t uniffi_iroh_checksum_constructor_publickey_from_bytes(void

);
uint16_t uniffi_iroh_checksum_constructor_ipv6addr_new(void
uint16_t uniffi_iroh_checksum_constructor_publickey_from_string(void

);
uint16_t uniffi_iroh_checksum_constructor_irohnode_new(void
uint16_t uniffi_iroh_checksum_constructor_query_all(void

);
uint16_t uniffi_iroh_checksum_constructor_namespaceid_from_string(void
uint16_t uniffi_iroh_checksum_constructor_query_author(void

);
uint16_t uniffi_iroh_checksum_constructor_peeraddr_new(void
uint16_t uniffi_iroh_checksum_constructor_query_key_exact(void

);
uint16_t uniffi_iroh_checksum_constructor_publickey_from_bytes(void
uint16_t uniffi_iroh_checksum_constructor_query_key_prefix(void

);
uint16_t uniffi_iroh_checksum_constructor_publickey_from_string(void
uint16_t uniffi_iroh_checksum_constructor_query_single_latest_per_key(void

);
uint16_t uniffi_iroh_checksum_constructor_socketaddr_from_ipv4(void
Expand Down
Loading

0 comments on commit d602b65

Please sign in to comment.