diff --git a/Cargo.lock b/Cargo.lock index 7dd9879d..f3a36440 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -18,9 +18,9 @@ dependencies = [ [[package]] name = "addr2line" -version = "0.24.1" +version = "0.24.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f5fb1d8e4442bd405fdfd1dacb42792696b0cf9cb15882e5d097b742a676d375" +checksum = "dfbe277e56a376000877090da837660b4427aad530e3028d44e0bffe4f89a1c1" dependencies = [ "gimli", ] @@ -74,7 +74,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e89da841a80418a9b391ebaea17f5c112ffaaa96f621d2c285b5174da76b9011" dependencies = [ "cfg-if", - "getrandom", "once_cell", "version_check", "zerocopy 0.7.35", @@ -112,9 +111,9 @@ dependencies = [ [[package]] name = "anstream" -version = "0.6.15" +version = "0.6.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "64e15c1ab1f89faffbf04a634d5e1962e9074f2741eef6d97f3c4e322426d526" +checksum = "23a1e53f0f5d86382dafe1cf314783b2044280f406e7e1506368220ad11b1338" dependencies = [ "anstyle", "anstyle-parse", @@ -127,43 +126,43 @@ dependencies = [ [[package]] name = "anstyle" -version = "1.0.8" +version = "1.0.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1bec1de6f59aedf83baf9ff929c98f2ad654b97c9510f4e70cf6f661d49fd5b1" +checksum = "8365de52b16c035ff4fcafe0092ba9390540e3e352870ac09933bebcaa2c8c56" [[package]] name = "anstyle-parse" -version = "0.2.5" +version = "0.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eb47de1e80c2b463c735db5b217a0ddc39d612e7ac9e2e96a5aed1f57616c1cb" +checksum = "3b2d16507662817a6a20a9ea92df6652ee4f94f914589377d69f3b21bc5798a9" dependencies = [ "utf8parse", ] [[package]] name = "anstyle-query" -version = "1.1.1" +version = "1.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d36fc52c7f6c869915e99412912f22093507da8d9e942ceaf66fe4b7c14422a" +checksum = "79947af37f4177cfead1110013d678905c37501914fba0efea834c3fe9a8d60c" dependencies = [ - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] name = "anstyle-wincon" -version = "3.0.4" +version = "3.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5bf74e1b6e971609db8ca7a9ce79fd5768ab6ae46441c572e46cf596f59e57f8" +checksum = "2109dbce0e72be3ec00bed26e6a7479ca384ad226efdd66db8fa2e3a38c83125" dependencies = [ "anstyle", - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] name = "anyhow" -version = "1.0.89" +version = "1.0.91" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86fdf8605db99b54d3cd748a44c6d04df638eb5dafb219b135d0149bd0db01f6" +checksum = "c042108f3ed77fd83760a5fd79b53be043192bb3b9dba91d8c574c0ada7850c8" [[package]] name = "anymap2" @@ -171,6 +170,12 @@ version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d301b3b94cb4b2f23d7917810addbbaff90738e0ca2be692bd027e70d7e0330c" +[[package]] +name = "arc-swap" +version = "1.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "69f7f8c3906b62b754cd5326047894316021dcfe5a194c8ea52bdd94934a3457" + [[package]] name = "arrayref" version = "0.3.9" @@ -207,7 +212,7 @@ checksum = "965c2d33e53cb6b267e148a4cb0760bc01f4904c1cd4bb4002a085bb016d1490" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.85", "synstructure 0.13.1", ] @@ -219,7 +224,7 @@ checksum = "7b18050c2cd6fe86c3a76584ef5e0baf286d038cda203eb6223df2cc413565f7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.85", ] [[package]] @@ -278,14 +283,14 @@ checksum = "3b43422f69d8ff38f95f1b2bb76517c91589a924d1559a0e935d7c8ce0274c11" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.85", ] [[package]] name = "async-stream" -version = "0.3.5" +version = "0.3.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd56dd203fef61ac097dd65721a419ddccb106b2d2b70ba60a6b529f03961a51" +checksum = "0b5a71a6f37880a80d1d7f19efd781e4b5de42c88f0722cc13bcb6cc2cfe8476" dependencies = [ "async-stream-impl", "futures-core", @@ -294,13 +299,13 @@ dependencies = [ [[package]] name = "async-stream-impl" -version = "0.3.5" +version = "0.3.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "16e62a023e7c117e27523144c5d2459f4397fcc3cab0085af8e2224f643a0193" +checksum = "c7c24de15d275a1ecfd47a380fb4d5ec9bfe0933f309ed5e705b775596a3574d" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.85", ] [[package]] @@ -311,7 +316,7 @@ checksum = "721cae7de5c34fbb2acd27e21e6d2cf7b886dce0c27388d46c4e6c47ea4318dd" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.85", ] [[package]] @@ -327,6 +332,12 @@ dependencies = [ "pin-project-lite", ] +[[package]] +name = "atomic-waker" +version = "1.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0" + [[package]] name = "attohttpc" version = "0.24.1" @@ -466,15 +477,12 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b048fb63fd8b5923fc5aa7b340d8e156aec7ec02f0c78fa8a6ddc2613f6f71de" [[package]] -name = "bitvec" -version = "1.0.1" +name = "bitpacking" +version = "0.9.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1bc2832c24239b0141d5674bb9174f9d68a8b5b3f2753311927c172ca46f7e9c" +checksum = "4c1d3e2bfd8d06048a179f7b17afc3188effa10385e7b00dc65af6aae732ea92" dependencies = [ - "funty", - "radium", - "tap", - "wyz", + "crunchy", ] [[package]] @@ -560,6 +568,12 @@ version = "3.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "79296716171880943b8470b5f8d03aa55eb2e645a4874bdbb28adb49162e012c" +[[package]] +name = "bytecount" +version = "0.6.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5ce89b21cab1437276d2650d57e971f9d548a2d9037cc231abdc0562b97498ce" + [[package]] name = "byteorder" version = "1.5.0" @@ -568,9 +582,9 @@ checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" [[package]] name = "bytes" -version = "1.7.2" +version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "428d9aa8fbc0670b7b8d6030a7fadd0f86151cae55e4dbbece15f3780a3dfaf3" +checksum = "9ac0150caa2ae65ca5bd83f25c7de183dea78d4d366469f148435e2acfbad0da" dependencies = [ "serde", ] @@ -598,6 +612,37 @@ dependencies = [ "system-deps", ] +[[package]] +name = "camino" +version = "1.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b96ec4966b5813e2c0507c1f86115c8c5abaadc3980879c3424042a02fd1ad3" +dependencies = [ + "serde", +] + +[[package]] +name = "cargo-platform" +version = "0.1.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "24b1f0365a6c6bb4020cd05806fd0d33c44d38046b8bd7f0e40814b9763cabfc" +dependencies = [ + "serde", +] + +[[package]] +name = "cargo_metadata" +version = "0.14.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4acbb09d9ee8e23699b9634375c72795d095bf268439da88562cf9b501f181fa" +dependencies = [ + "camino", + "cargo-platform", + "semver", + "serde", + "serde_json", +] + [[package]] name = "cbor4ii" version = "0.2.14" @@ -618,13 +663,21 @@ dependencies = [ [[package]] name = "cc" -version = "1.1.23" +version = "1.1.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3bbb537bb4a30b90362caddba8f360c0a56bc13d3a5570028e7197204cb54a17" +checksum = "c2e7962b54006dcfcc61cb72735f4d89bb97061dd6a7ed882ec6b8ee53714c6f" dependencies = [ + "jobserver", + "libc", "shlex", ] +[[package]] +name = "census" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4f4c707c6a209cbe82d10abd08e1ea8995e9ea937d2550646e02798948992be0" + [[package]] name = "cesu8" version = "1.1.0" @@ -709,7 +762,7 @@ checksum = "3147d8272e8fa0ccd29ce51194dd98f79ddfb8191ba9e3409884e751798acf3a" dependencies = [ "core2", "multibase", - "multihash 0.19.1", + "multihash 0.19.2", "serde", "serde_bytes", "unsigned-varint 0.8.0", @@ -734,9 +787,9 @@ checksum = "67ba02a97a2bd10f4b59b25c7973101c79642302776489e030cd13cdab09ed15" [[package]] name = "colorchoice" -version = "1.0.2" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3fd119d74b830634cea2a0f58bbd0d54540518a14397557951e79340abc28c0" +checksum = "5b63caa9aa9397e2d9480a9b13673856c78d8ac123288526c37d7839f2a86990" [[package]] name = "combine" @@ -778,6 +831,16 @@ dependencies = [ "unicode-segmentation", ] +[[package]] +name = "cordyceps" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec10f0a762d93c4498d2e97a333805cb6250d60bead623f71d8034f9a4152ba3" +dependencies = [ + "loom", + "tracing", +] + [[package]] name = "core-foundation" version = "0.9.4" @@ -827,6 +890,43 @@ version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "19d374276b40fb8bbdee95aef7c7fa6b5316ec764510eb64b8dd0e2ed0d7e7f5" +[[package]] +name = "crc32fast" +version = "1.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a97769d94ddab943e4510d138150169a2758b5ef3eb191a9ee688de3e23ef7b3" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "crossbeam-channel" +version = "0.5.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "33480d6946193aa8033910124896ca395333cae7e2d1113d1fef6c3272217df2" +dependencies = [ + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-deque" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "613f8cc01fe9cf1a3eb3d7f488fd2fa8388403e97039e2f73692932e291a770d" +dependencies = [ + "crossbeam-epoch", + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-epoch" +version = "0.9.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b82ac4a3c2ca9c3460964f020e1402edd5753411d7737aa39c3714ad1b5420e" +dependencies = [ + "crossbeam-utils", +] + [[package]] name = "crossbeam-utils" version = "0.8.20" @@ -937,17 +1037,7 @@ checksum = "f46882e17999c6cc590af592290432be3bce0428cb0d5f8b6715e4dc7b383eb3" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", -] - -[[package]] -name = "daggy" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91a9304e55e9d601a39ae4deaba85406d5c0980e106f65afcf0460e9af1e7602" -dependencies = [ - "petgraph", - "serde", + "syn 2.0.85", ] [[package]] @@ -957,7 +1047,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "978747c1d849a7d2ee5e8adc0159961c48fb7e5db2f06af6723b80123bb53856" dependencies = [ "cfg-if", - "hashbrown", + "hashbrown 0.14.5", "lock_api", "once_cell", "parking_lot_core", @@ -1023,7 +1113,7 @@ checksum = "8034092389675178f570469e6c3b0465d3d30b4505c294a6550db47f3c17ad18" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.85", ] [[package]] @@ -1054,7 +1144,7 @@ dependencies = [ "convert_case", "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.85", "unicode-xid", ] @@ -1120,7 +1210,7 @@ checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.85", ] [[package]] @@ -1149,6 +1239,12 @@ dependencies = [ "litrs", ] +[[package]] +name = "downcast-rs" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75b325c5dbd37f80359721ad39aca5a29fb04c89279657cffdda8736d0c0b9d2" + [[package]] name = "dtoa" version = "1.0.9" @@ -1272,7 +1368,7 @@ dependencies = [ "heck 0.5.0", "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.85", ] [[package]] @@ -1285,7 +1381,7 @@ dependencies = [ "num-traits", "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.85", ] [[package]] @@ -1305,7 +1401,7 @@ checksum = "de0d48a183585823424a4ce1aa132d174a6a81bd540895822eb4c8373a8e49e8" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.85", ] [[package]] @@ -1362,6 +1458,15 @@ dependencies = [ "windows-sys 0.52.0", ] +[[package]] +name = "error-chain" +version = "0.12.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2d2f06b9cac1506ece98fe3231e3cc9c4410ec3d5b1f24ae1c8946f0742cdefc" +dependencies = [ + "version_check", +] + [[package]] name = "event-listener" version = "4.0.3" @@ -1400,6 +1505,12 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2acce4a10f12dc2fb14a218589d4f1f62ef011b2d0cc4b3cb1bba8e94da14649" +[[package]] +name = "fastdivide" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "59668941c55e5c186b8b58c391629af56774ec768f73c08bbcd56f09348eb00b" + [[package]] name = "fastrand" version = "1.9.0" @@ -1459,11 +1570,17 @@ version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0ce7134b9999ecaf8bcd65542e436736ef32ddca1b3e06094cb6ec5755203b80" +[[package]] +name = "fixedbitset" +version = "0.5.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d674e81391d1e1ab681a28d99df07927c6d4aa5b027d7da16ba32d1d21ecd99" + [[package]] name = "flume" -version = "0.11.0" +version = "0.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "55ac459de2512911e4b674ce33cf20befaba382d05b62b008afc1c8b57cbf181" +checksum = "da0e4dd2a88388a1f4ccc7c9ce104604dab68d9f408dc34cd45823d5a9069095" dependencies = [ "futures-core", "futures-sink", @@ -1477,6 +1594,12 @@ version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" +[[package]] +name = "foldhash" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f81ec6369c545a7d40e4589b5597581fa1c441fe1cce96dd1de43159910a36a2" + [[package]] name = "form_urlencoded" version = "1.2.1" @@ -1497,10 +1620,14 @@ dependencies = [ ] [[package]] -name = "funty" -version = "2.0.0" +name = "fs4" +version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6d5a32815ae3f33302d95fdcb2ce17862f8c65363dcfd29360480ba1001fc9c" +checksum = "f7e180ac76c23b45e767bd7ae9579bc0bb458618c4bc71835926e098e61d15f8" +dependencies = [ + "rustix", + "windows-sys 0.52.0", +] [[package]] name = "fuse_mt" @@ -1531,9 +1658,9 @@ dependencies = [ [[package]] name = "futures" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "645c6916888f6cb6350d2550b80fb63e734897a8498abe35cfb732b6487804b0" +checksum = "65bc07b1a8bc7c85c5f2e110c476c7389b4554ba72af57d8445ea63a576b0876" dependencies = [ "futures-channel", "futures-core", @@ -1556,10 +1683,11 @@ dependencies = [ [[package]] name = "futures-buffered" -version = "0.2.8" +version = "0.2.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91fa130f3777d0d4b0993653c20bc433026d3290627693c4ed1b18dd237357ab" +checksum = "34acda8ae8b63fbe0b2195c998b180cff89a8212fb2622a78b572a9f1c6f7684" dependencies = [ + "cordyceps", "diatomic-waker", "futures-core", "pin-project-lite", @@ -1567,9 +1695,9 @@ dependencies = [ [[package]] name = "futures-channel" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eac8f7d7865dcb88bd4373ab671c8cf4508703796caa2b1985a9ca867b3fcb78" +checksum = "2dff15bf788c671c1934e366d07e30c1814a8ef514e1af724a602e8a2fbe1b10" dependencies = [ "futures-core", "futures-sink", @@ -1577,11 +1705,11 @@ dependencies = [ [[package]] name = "futures-concurrency" -version = "7.6.1" +version = "7.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4b14ac911e85d57c5ea6eef76d7b4d4a3177ecd15f4bea2e61927e9e3823e19f" +checksum = "d9b724496da7c26fcce66458526ce68fc2ecf4aaaa994281cf322ded5755520c" dependencies = [ - "bitvec", + "fixedbitset 0.5.7", "futures-buffered", "futures-core", "futures-lite 1.13.0", @@ -1592,15 +1720,15 @@ dependencies = [ [[package]] name = "futures-core" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dfc6580bb841c5a68e9ef15c77ccc837b40a7504914d52e47b8b0e9bbda25a1d" +checksum = "05f29059c0c2090612e8d742178b0580d2dc940c837851ad723096f87af6663e" [[package]] name = "futures-executor" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a576fc72ae164fca6b9db127eaa9a9dda0d61316034f33a0a0d4eda41f02b01d" +checksum = "1e28d1d997f585e54aebc3f97d39e72338912123a67330d723fdbb564d646c9f" dependencies = [ "futures-core", "futures-task", @@ -1610,9 +1738,9 @@ dependencies = [ [[package]] name = "futures-io" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a44623e20b9681a318efdd71c299b6b222ed6f231972bfe2f224ebad6311f0c1" +checksum = "9e5c1b78ca4aae1ac06c48a526a655760685149f0d465d21f37abfe57ce075c6" [[package]] name = "futures-lite" @@ -1644,13 +1772,13 @@ dependencies = [ [[package]] name = "futures-macro" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" +checksum = "162ee34ebcb7c64a8abebc059ce0fee27c2262618d7b60ed8faf72fef13c3650" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.85", ] [[package]] @@ -1666,15 +1794,15 @@ dependencies = [ [[package]] name = "futures-sink" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9fb8e00e87438d937621c1c6269e53f536c14d3fbd6a042bb24879e57d474fb5" +checksum = "e575fab7d1e0dcb8d0c7bcf9a63ee213816ab51902e6d244a95819acacf1d4f7" [[package]] name = "futures-task" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38d84fa142264698cdce1a9f9172cf383a0c82de1bddcf3092901442c4097004" +checksum = "f90f7dce0722e95104fcb095585910c0977252f286e354b5e3bd38902cd99988" [[package]] name = "futures-ticker" @@ -1710,9 +1838,9 @@ dependencies = [ [[package]] name = "futures-util" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d6401deb83407ab3da39eba7e33987a73c3df0c82b4bb5813ee871c19c41d48" +checksum = "9fa08315bb612088cc391249efdc3bc77536f16c91f6cf495e6fbe85b20a4a81" dependencies = [ "futures-channel", "futures-core", @@ -1814,6 +1942,19 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "generator" +version = "0.7.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5cc16584ff22b460a382b7feec54b23d2908d858152e5739a120b949293bd74e" +dependencies = [ + "cc", + "libc", + "log", + "rustversion", + "windows 0.48.0", +] + [[package]] name = "generic-array" version = "0.14.7" @@ -1850,9 +1991,9 @@ dependencies = [ [[package]] name = "gimli" -version = "0.31.0" +version = "0.31.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32085ea23f3234fc7846555e85283ba4de91e21016dc0455a16286d87a292d64" +checksum = "07e28edb80900c19c28f1072f2e8aeca7fa06b23cd4169cefe1af5aa3260783f" [[package]] name = "gio" @@ -1915,7 +2056,7 @@ dependencies = [ "proc-macro-crate 3.2.0", "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.85", ] [[package]] @@ -2072,7 +2213,7 @@ dependencies = [ "proc-macro-crate 3.2.0", "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.85", ] [[package]] @@ -2113,6 +2254,25 @@ dependencies = [ "tracing", ] +[[package]] +name = "h2" +version = "0.4.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "524e8ac6999421f49a846c2d4411f337e53497d8ec55d67753beffa43c5d9205" +dependencies = [ + "atomic-waker", + "bytes", + "fnv", + "futures-core", + "futures-sink", + "http 1.1.0", + "indexmap", + "slab", + "tokio", + "tokio-util", + "tracing", +] + [[package]] name = "hashbrown" version = "0.14.5" @@ -2120,7 +2280,17 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" dependencies = [ "ahash", +] + +[[package]] +name = "hashbrown" +version = "0.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e087f84d4f86bf4b218b927129862374b72199ae7d8657835f1e89000eea4fb" +dependencies = [ "allocator-api2", + "equivalent", + "foldhash", ] [[package]] @@ -2129,7 +2299,7 @@ version = "0.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6ba4ff7128dee98c7dc9794b6a411377e1404dba1c97deb8d1a55297bd25d8af" dependencies = [ - "hashbrown", + "hashbrown 0.14.5", ] [[package]] @@ -2316,15 +2486,6 @@ version = "1.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3688e69b38018fec1557254f64c8dc2cc8ec502890182f395dbb0aa997aa5735" -[[package]] -name = "home" -version = "0.5.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3d1354bf6b7235cb4a0576c2619fd4ed18183f689b12b006a0ee7329eeff9a5" -dependencies = [ - "windows-sys 0.52.0", -] - [[package]] name = "hostname" version = "0.3.1" @@ -2351,6 +2512,12 @@ dependencies = [ "utf8-width", ] +[[package]] +name = "htmlescape" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e9025058dae765dee5070ec375f591e2ba14638c63feff74f13805a72e523163" + [[package]] name = "http" version = "0.2.12" @@ -2427,15 +2594,15 @@ checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4" [[package]] name = "hyper" -version = "0.14.30" +version = "0.14.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a152ddd61dfaec7273fe8419ab357f33aee0d914c5f4efbf0d96fa749eea5ec9" +checksum = "8c08302e8fa335b151b788c775ff56e7a03ae64ff85c548ee820fecb70356e85" dependencies = [ "bytes", "futures-channel", "futures-core", "futures-util", - "h2", + "h2 0.3.26", "http 0.2.12", "http-body 0.4.6", "httparse", @@ -2451,13 +2618,14 @@ dependencies = [ [[package]] name = "hyper" -version = "1.4.1" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50dfd22e0e76d0f662d429a5f80fcaf3855009297eab6a0a9f8543834744ba05" +checksum = "bbbff0a806a4728c99295b254c8838933b5b082d75e3cb70c8dab21fdfbcfa9a" dependencies = [ "bytes", "futures-channel", "futures-util", + "h2 0.4.6", "http 1.1.0", "http-body 1.0.1", "httparse", @@ -2477,7 +2645,7 @@ checksum = "08afdbb5c31130e3034af566421053ab03787c640246a446327f550d11bcb333" dependencies = [ "futures-util", "http 1.1.0", - "hyper 1.4.1", + "hyper 1.5.0", "hyper-util", "rustls", "rustls-pki-types", @@ -2498,7 +2666,7 @@ dependencies = [ "futures-util", "http 1.1.0", "http-body 1.0.1", - "hyper 1.4.1", + "hyper 1.5.0", "pin-project-lite", "socket2", "tokio", @@ -2531,9 +2699,9 @@ dependencies = [ [[package]] name = "idb" -version = "0.6.3" +version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2764bba4203538c2ef2d733d5bad8fdb4622b1ebc5560831279db7b3be1332e8" +checksum = "3afe8830d5802f769dc0be20a87f9f116798c896650cb6266eb5c19a3c109eed" dependencies = [ "js-sys", "num-traits", @@ -2603,7 +2771,7 @@ dependencies = [ "bytes", "futures", "http 0.2.12", - "hyper 0.14.30", + "hyper 0.14.31", "log", "rand", "tokio", @@ -2612,26 +2780,34 @@ dependencies = [ ] [[package]] -name = "indexmap" -version = "2.5.0" +name = "igd-next" +version = "0.15.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68b900aa2f7301e21c36462b170ee99994de34dff39a4a6a528e80e7376d07e5" +checksum = "76b0d7d4541def58a37bf8efc559683f21edce7c82f0d866c93ac21f7e098f93" dependencies = [ - "equivalent", - "hashbrown", + "async-trait", + "attohttpc", + "bytes", + "futures", + "http 1.1.0", + "http-body-util", + "hyper 1.5.0", + "hyper-util", + "log", + "rand", + "tokio", + "url", + "xmltree", ] [[package]] -name = "indicium" -version = "0.6.2" +name = "indexmap" +version = "2.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dad485fffc88ba6a172b6435f65594a63463b5261b5b7151d0e8b498e2aa18b9" +checksum = "707907fe3c25f5424cce2cb7e1cbcafee6bdbe735ca90ef77c29e84591e5b9da" dependencies = [ - "ahash", - "kstring", - "serde", - "strsim", - "tracing", + "equivalent", + "hashbrown 0.15.0", ] [[package]] @@ -2701,15 +2877,15 @@ dependencies = [ [[package]] name = "ipnet" -version = "2.10.0" +version = "2.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "187674a687eed5fe42285b40c6291f9a01517d415fad1c3cbc6a9f778af7fcd4" +checksum = "ddc24109865250148c2e0f3d25d4f0f479571723792d3802153c60922a4fb708" [[package]] name = "iroh" -version = "0.26.0" +version = "0.27.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "abda3be73097cc12c2e0fd3dd8babc37aad43711bb7ff9c8952ff6a33986a45a" +checksum = "5d466e52e137738e33dc334518c37b3c7c0502f9f838ffea4d771a9dd882e0f0" dependencies = [ "anyhow", "async-channel", @@ -2752,9 +2928,9 @@ dependencies = [ [[package]] name = "iroh-base" -version = "0.26.0" +version = "0.27.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "973c0b3c7851fa2e8e6cf4cb81c9f4cab1373848828fafa43dfe25b123a89ff2" +checksum = "28a777d7e0b3e2fdab4ad1b21b64be87a43ac3ceb2a2ccef905e480ad3317396" dependencies = [ "aead", "anyhow", @@ -2769,7 +2945,7 @@ dependencies = [ "postcard", "rand", "rand_core", - "redb 2.1.3", + "redb 2.1.4", "serde", "serde-error", "ssh-key", @@ -2794,9 +2970,9 @@ dependencies = [ [[package]] name = "iroh-blobs" -version = "0.26.0" +version = "0.27.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9afc7ad5c2aaa1b17071fe99065c6cfbe7a3f0597ecc44381afdddb47965521f" +checksum = "69e83475d6c8cc312a224d4c6bdf287f862d30d2b176768ef71f188a0d8aa7cd" dependencies = [ "anyhow", "async-channel", @@ -2822,7 +2998,7 @@ dependencies = [ "rand", "range-collections", "redb 1.5.1", - "redb 2.1.3", + "redb 2.1.4", "reflink-copy", "self_cell", "serde", @@ -2837,9 +3013,9 @@ dependencies = [ [[package]] name = "iroh-docs" -version = "0.26.0" +version = "0.27.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8138011bd4e9a5b24a6bdddd50232aa2778a8b430d0f91d32ddba5f88a126ddc" +checksum = "fb2c8bc1fe680549dd9776031be30e68663884026f71a914aab7108e0b8f8ce4" dependencies = [ "anyhow", "async-channel", @@ -2862,7 +3038,7 @@ dependencies = [ "rand", "rand_core", "redb 1.5.1", - "redb 2.1.3", + "redb 2.1.4", "self_cell", "serde", "strum 0.25.0", @@ -2876,9 +3052,9 @@ dependencies = [ [[package]] name = "iroh-gossip" -version = "0.26.0" +version = "0.27.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b44749f361aca7cddcb357b62ef84cad1023771aee03d427c8922991fc4a9561" +checksum = "b434d455389493ff2b2ecbab035c12eb3762f24d04080855ecd4956bf7739448" dependencies = [ "anyhow", "async-channel", @@ -2917,14 +3093,14 @@ dependencies = [ [[package]] name = "iroh-metrics" -version = "0.26.0" +version = "0.27.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "02edfa7ca1aa89b0b9793d94671e32b79c97d61e9022f082c5eb2b95b64e90c0" +checksum = "0c78cf30022e1c7a10fc0ae0a6ba83f131b7c3b92d4876f6c97aba93fe534be6" dependencies = [ "anyhow", "erased_set", "http-body-util", - "hyper 1.4.1", + "hyper 1.5.0", "hyper-util", "once_cell", "prometheus-client", @@ -2938,9 +3114,9 @@ dependencies = [ [[package]] name = "iroh-net" -version = "0.26.0" +version = "0.27.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "329553be056a92eec7802e1c087eed951eec6e60f0f0740491ef16a295be4ca2" +checksum = "34192d8846fc59d6669fb80a485b430215ecc1bf3c2b9df4f8a92370fe37e13a" dependencies = [ "anyhow", "backoff", @@ -2962,9 +3138,9 @@ dependencies = [ "hostname", "http 1.1.0", "http-body-util", - "hyper 1.4.1", + "hyper 1.5.0", "hyper-util", - "igd-next", + "igd-next 0.15.1", "iroh-base", "iroh-metrics", "iroh-quinn", @@ -3024,7 +3200,7 @@ dependencies = [ "iroh-quinn-proto", "iroh-quinn-udp", "pin-project-lite", - "rustc-hash", + "rustc-hash 2.0.0", "rustls", "socket2", "thiserror", @@ -3041,7 +3217,7 @@ dependencies = [ "bytes", "rand", "ring 0.17.8", - "rustc-hash", + "rustc-hash 2.0.0", "rustls", "rustls-platform-verifier", "slab", @@ -3094,6 +3270,15 @@ version = "1.70.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7943c866cc5cd64cbc25b2e01621d07fa8eb2a1a23160ee81ce38704e97b8ecf" +[[package]] +name = "itertools" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba291022dbbd398a455acf126c1e341954079855bc60dfdda641363bd6922569" +dependencies = [ + "either", +] + [[package]] name = "itertools" version = "0.13.0" @@ -3152,11 +3337,20 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8eaf4bc02d17cbdd7ff4c7438cafcdf7fb9a4613313ad11b4f8fefe7d3fa0130" +[[package]] +name = "jobserver" +version = "0.1.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "48d1dbcbbeb6a7fec7e059840aa538bd62aaccf972c7346c4d9d2059312853d0" +dependencies = [ + "libc", +] + [[package]] name = "js-sys" -version = "0.3.70" +version = "0.3.72" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1868808506b929d7b0cfa8f75951347aa71bb21144b7791bae35d9bccfcfe37a" +checksum = "6a88f1bda2bd75b0452a14784937d796722fdebfe50df998aeb3f0b7603019a9" dependencies = [ "wasm-bindgen", ] @@ -3189,6 +3383,12 @@ dependencies = [ "spin 0.9.8", ] +[[package]] +name = "levenshtein_automata" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c2cdeb66e45e9f36bfad5bbdb4d2384e70936afbee843c6f6543f0c551ebb25" + [[package]] name = "libadwaita" version = "0.7.0" @@ -3222,9 +3422,9 @@ dependencies = [ [[package]] name = "libc" -version = "0.2.159" +version = "0.2.161" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "561d97a539a36e26a9a5fad1ea11a3039a67714694aaa379433e580854bc3dc5" +checksum = "8e9489c2807c139ffd9c1794f4af0ebe86a828db53ecdc7fea2111d0fed085d1" [[package]] name = "libipld-core" @@ -3365,7 +3565,7 @@ dependencies = [ "futures-timer", "libp2p-identity", "multiaddr", - "multihash 0.19.1", + "multihash 0.19.2", "multistream-select", "once_cell", "parking_lot", @@ -3487,7 +3687,7 @@ dependencies = [ "ed25519-dalek", "hkdf", "libsecp256k1", - "multihash 0.19.1", + "multihash 0.19.2", "p256", "quick-protobuf", "rand", @@ -3586,7 +3786,7 @@ dependencies = [ "libp2p-core", "libp2p-identity", "multiaddr", - "multihash 0.19.1", + "multihash 0.19.2", "once_cell", "quick-protobuf", "rand", @@ -3669,7 +3869,7 @@ dependencies = [ [[package]] name = "libp2p-relay-manager" version = "0.3.0" -source = "git+https://github.com/dariusc93/rust-ipfs.git?branch=libp2p-next#3bbab8bd72736fb383a2c96dbc01eb809f72ef1f" +source = "git+https://github.com/dariusc93/rust-ipfs.git?branch=libp2p-next#84c6e4439c550b48bfc9e062bd1baa9e9ea39772" dependencies = [ "anyhow", "futures", @@ -3764,7 +3964,7 @@ dependencies = [ "heck 0.5.0", "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.85", ] [[package]] @@ -3811,7 +4011,7 @@ checksum = "01bf2d1b772bd3abca049214a3304615e6a36fa6ffc742bdd1ba774486200b8f" dependencies = [ "futures", "futures-timer", - "igd-next", + "igd-next 0.14.3", "libp2p-core", "libp2p-swarm", "tokio", @@ -3870,7 +4070,7 @@ dependencies = [ "libp2p-identity", "libp2p-noise", "multiaddr", - "multihash 0.19.1", + "multihash 0.19.2", "send_wrapper 0.6.0", "thiserror", "tracing", @@ -3985,7 +4185,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2752e978ffc53670f3f2e8b3ef09f348d6f7b5474a3be3f8a5befe5382e4effb" dependencies = [ "anymap2", - "itertools", + "itertools 0.13.0", "kstring", "liquid-derive", "num-traits", @@ -4004,7 +4204,7 @@ checksum = "3b51f1d220e3fa869e24cfd75915efe3164bd09bb11b3165db3f37f57bf673e3" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.85", ] [[package]] @@ -4014,7 +4214,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "59b1a298d3d2287ee5b1e43840d885b8fdfc37d3f4e90d82aacfd04d021618da" dependencies = [ "deunicode", - "itertools", + "itertools 0.13.0", "liquid-core", "once_cell", "percent-encoding", @@ -4045,13 +4245,26 @@ version = "0.4.22" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a7a70ba024b9dc04c27ea2f0c0548feb474ec5c54bba33a7f72f873a39d07b24" +[[package]] +name = "loom" +version = "0.5.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ff50ecb28bb86013e935fb6683ab1f6d3a20016f123c76fd4c27470076ac30f5" +dependencies = [ + "cfg-if", + "generator", + "scoped-tls", + "tracing", + "tracing-subscriber", +] + [[package]] name = "lru" -version = "0.12.4" +version = "0.12.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "37ee39891760e7d94734f6f63fedc29a2e4a152f836120753a72503f09fcf904" +checksum = "234cf4f4a04dc1f57e24b96cc0cd600cf2af460d4161ac5ecdd0af8e1f3b2a38" dependencies = [ - "hashbrown", + "hashbrown 0.15.0", ] [[package]] @@ -4063,6 +4276,12 @@ dependencies = [ "linked-hash-map", ] +[[package]] +name = "lz4_flex" +version = "0.11.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75761162ae2b0e580d7e7c390558127e5f01b4194debd6221fd8c207fc80e3f5" + [[package]] name = "mainline" version = "2.0.1" @@ -4109,12 +4328,31 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ffbee8634e0d45d258acb448e7eaab3fce7a0a467395d4d9f228e3c1f01fb2e4" +[[package]] +name = "matchers" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8263075bb86c5a1b1427b5ae862e8889656f126e9f77c484496e8b47cf5c5558" +dependencies = [ + "regex-automata 0.1.10", +] + [[package]] name = "md5" version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "490cc448043f947bae3cbee9c203358d62dbee0db12107a74be5c30ccfd09771" +[[package]] +name = "measure_time" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dbefd235b0aadd181626f281e1d684e116972988c14c264e42069d5e8a5775cc" +dependencies = [ + "instant", + "log", +] + [[package]] name = "memalloc" version = "0.1.0" @@ -4127,6 +4365,15 @@ version = "2.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" +[[package]] +name = "memmap2" +version = "0.9.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fd3f7eed9d3848f8b98834af67102b720745c4ec028fcd0aa0239277e7de374f" +dependencies = [ + "libc", +] + [[package]] name = "memoffset" version = "0.9.1" @@ -4164,7 +4411,7 @@ checksum = "dcf09caffaac8068c346b6df2a7fc27a177fd20b39421a39ce0a211bde679a6c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.85", ] [[package]] @@ -4211,7 +4458,7 @@ dependencies = [ "data-encoding", "libp2p-identity", "multibase", - "multihash 0.19.1", + "multihash 0.19.2", "percent-encoding", "serde", "static_assertions", @@ -4251,27 +4498,27 @@ dependencies = [ [[package]] name = "multihash" -version = "0.19.1" +version = "0.19.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "076d548d76a0e2a0d4ab471d0b1c36c577786dfc4471242035d97a12a735c492" +checksum = "cc41f430805af9d1cf4adae4ed2149c759b877b01d909a1f40256188d09345d2" dependencies = [ "core2", "serde", - "unsigned-varint 0.7.2", + "unsigned-varint 0.8.0", ] [[package]] name = "multihash-codetable" -version = "0.1.3" +version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c35f0fb09f635b18e95053fc2a9a4843272d3acf898792a14471dcf6f83df0cc" +checksum = "67996849749d25f1da9f238e8ace2ece8f9d6bdf3f9750aaf2ae7de3a5cad8ea" dependencies = [ "blake2b_simd", "blake2s_simd", "blake3", "core2", "digest 0.10.7", - "multihash-derive 0.9.0", + "multihash-derive 0.9.1", "ripemd", "sha1", "sha2 0.10.8", @@ -4295,26 +4542,25 @@ dependencies = [ [[package]] name = "multihash-derive" -version = "0.9.0" +version = "0.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "890e72cb7396cb99ed98c1246a97b243cc16394470d94e0bc8b0c2c11d84290e" +checksum = "1f1b7edab35d920890b88643a765fc9bd295cf0201f4154dda231bef9b8404eb" dependencies = [ "core2", - "multihash 0.19.1", + "multihash 0.19.2", "multihash-derive-impl", ] [[package]] name = "multihash-derive-impl" -version = "0.1.1" +version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3958713ce794e12f7c6326fac9aa274c68d74c4881dd37b3e2662b8a2046bb19" +checksum = "e3dc7141bd06405929948754f0628d247f5ca1865be745099205e5086da957cb" dependencies = [ - "proc-macro-crate 2.0.0", - "proc-macro-error 1.0.4", + "proc-macro-crate 3.2.0", "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.85", "synstructure 0.13.1", ] @@ -4332,6 +4578,12 @@ dependencies = [ "unsigned-varint 0.7.2", ] +[[package]] +name = "murmurhash32" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2195bf6aa996a481483b29d62a7663eed3fe39600c460e323f8ff41e90bdd89b" + [[package]] name = "nanorand" version = "0.7.0" @@ -4341,6 +4593,59 @@ dependencies = [ "getrandom", ] +[[package]] +name = "native_db" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db7c6b50f9889052a3c1bbd3aa70cc33b76ec1761092aeb0ec0e1ac3cfdb881a" +dependencies = [ + "native_db_macro", + "native_model", + "redb 1.5.1", + "redb 2.1.4", + "semver", + "serde", + "skeptic", + "thiserror", +] + +[[package]] +name = "native_db_macro" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "434acde56fc4485e0b62533bb2fbc08155ee7e47408b1358348acff556c31b3c" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.85", +] + +[[package]] +name = "native_model" +version = "0.4.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c10f4542302b7fa69ef18b49d93106e27f20b59d695555121d9ed22fe5d716a8" +dependencies = [ + "anyhow", + "bincode", + "native_model_macro", + "serde", + "skeptic", + "thiserror", + "zerocopy 0.8.7", +] + +[[package]] +name = "native_model_macro" +version = "0.4.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2f385f3d57adaea8d8868e65a0bc821bcb8ba2228bbf87a1c3c6144ac48f3791" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.85", +] + [[package]] name = "nested_enum_utils" version = "0.1.0" @@ -4532,6 +4837,16 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "38bf9645c8b145698bb0b18a4637dcacbc421ea49bef2317e4fd8065a387cf21" +[[package]] +name = "nu-ansi-term" +version = "0.46.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77a8165726e8236064dbb45459242600304b42a5ea24ee2948e18e023bf7ba84" +dependencies = [ + "overload", + "winapi", +] + [[package]] name = "num-bigint" version = "0.4.6" @@ -4623,14 +4938,14 @@ dependencies = [ "proc-macro-crate 3.2.0", "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.85", ] [[package]] name = "object" -version = "0.36.4" +version = "0.36.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "084f1a5821ac4c651660a94a7153d27ac9d8a53736203f58b31945ded098070a" +checksum = "aedf0a2d09c573ed1d8d85b30c119153926a2b36dce0ab28322c09a117a4683e" dependencies = [ "memchr", ] @@ -4652,7 +4967,6 @@ dependencies = [ "bytes", "chrono", "cid 0.11.1", - "daggy", "directories-next", "env_logger", "futures", @@ -4663,7 +4977,6 @@ dependencies = [ "glob", "gtk4", "html-escape", - "indicium", "lazy_static", "libadwaita", "liquid", @@ -4671,12 +4984,16 @@ dependencies = [ "liquid-lib", "log", "miette", + "native_db", + "native_model", "oku-fs", "once_cell", "open", "pango", + "rayon", "rust-ipfs", "serde", + "tantivy", "tokio", "tokio-stream", "toml 0.8.19", @@ -4689,7 +5006,7 @@ dependencies = [ [[package]] name = "oku-fs" version = "0.1.0" -source = "git+https://github.com/OkuBrowser/oku-fs#bd6a64204cc512bb75e2a3afb403d5bc9bf3595b" +source = "git+https://github.com/OkuBrowser/oku-fs#df8695d6622caec020e645512c2dfee0d83ff8b8" dependencies = [ "anyhow", "async-trait", @@ -4706,20 +5023,24 @@ dependencies = [ "log", "mainline 3.0.0", "miette", + "native_db", + "native_model", "path-clean", + "rayon", + "serde", + "tantivy", "thiserror", "tokio", + "toml 0.8.19", "ucan", + "url", ] [[package]] name = "once_cell" -version = "1.20.1" +version = "1.20.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "82881c4be219ab5faaf2ad5e5e5ecdff8c66bd7402ca3160975c93b24961afd1" -dependencies = [ - "portable-atomic", -] +checksum = "1261fe7e33c73b354eab43b1273a57c8f967d0391e80353e51f764ac02cf6775" [[package]] name = "oneshot" @@ -4760,6 +5081,21 @@ dependencies = [ "windows-sys 0.59.0", ] +[[package]] +name = "overload" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b15813163c1d831bf4a13c3610c05c0d03b39feb07f7e09fa234dac9b15aaf39" + +[[package]] +name = "ownedbytes" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c3a059efb063b8f425b948e042e6b9bd85edfe60e913630ed727b23e2dfcc558" +dependencies = [ + "stable_deref_trait", +] + [[package]] name = "owo-colors" version = "4.1.0" @@ -4881,9 +5217,9 @@ checksum = "17359afc20d7ab31fdb42bb844c8b3bb1dabd7dcf7e68428492da7f16966fcef" [[package]] name = "pathdiff" -version = "0.2.1" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8835116a5c179084a830efb3adc117ab007512b535bc1a21c991d3b32a6b44dd" +checksum = "d61c5ce1153ab5b689d0c074c4e7fc613e942dfb7dd9eea5ab202d2ad91fe361" [[package]] name = "pem" @@ -4912,9 +5248,9 @@ checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" [[package]] name = "pest" -version = "2.7.13" +version = "2.7.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fdbef9d1d47087a895abd220ed25eb4ad973a5e26f6a4367b038c25e28dfc2d9" +checksum = "879952a81a83930934cbf1786752d6dedc3b1f29e8f8fb2ad1d0a36f377cf442" dependencies = [ "memchr", "thiserror", @@ -4923,9 +5259,9 @@ dependencies = [ [[package]] name = "pest_derive" -version = "2.7.13" +version = "2.7.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4d3a6e3394ec80feb3b6393c725571754c6188490265c61aaf260810d6b95aa0" +checksum = "d214365f632b123a47fd913301e14c946c61d1c183ee245fa76eb752e59a02dd" dependencies = [ "pest", "pest_generator", @@ -4933,22 +5269,22 @@ dependencies = [ [[package]] name = "pest_generator" -version = "2.7.13" +version = "2.7.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94429506bde1ca69d1b5601962c73f4172ab4726571a59ea95931218cb0e930e" +checksum = "eb55586734301717aea2ac313f50b2eb8f60d2fc3dc01d190eefa2e625f60c4e" dependencies = [ "pest", "pest_meta", "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.85", ] [[package]] name = "pest_meta" -version = "2.7.13" +version = "2.7.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac8a071862e93690b6e34e9a5fb8e33ff3734473ac0245b27232222c4906a33f" +checksum = "b75da2a70cf4d9cb76833c990ac9cd3923c9a8905a8929789ce347c84564d03d" dependencies = [ "once_cell", "pest", @@ -4961,37 +5297,35 @@ version = "0.6.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b4c5cc86750666a3ed20bdaf5ca2a0344f9c67674cae0515bec2da16fbaa47db" dependencies = [ - "fixedbitset", + "fixedbitset 0.4.2", "indexmap", - "serde", - "serde_derive", ] [[package]] name = "pin-project" -version = "1.1.5" +version = "1.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6bf43b791c5b9e34c3d182969b4abb522f9343702850a2e57f460d00d09b4b3" +checksum = "be57f64e946e500c8ee36ef6331845d40a93055567ec57e8fae13efd33759b95" dependencies = [ "pin-project-internal", ] [[package]] name = "pin-project-internal" -version = "1.1.5" +version = "1.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2f38a4412a78282e09a2cf38d195ea5420d15ba0602cb375210efbc877243965" +checksum = "3c0f5fad0874fc7abcd4d750e76917eaebbecaa2c20bde22e1dbeeba8beb758c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.85", ] [[package]] name = "pin-project-lite" -version = "0.2.14" +version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bda66fc9667c18cb2758a2ac84d1167245054bcf85d5d1aaa6923f45801bdd02" +checksum = "915a1e146535de9163f3987b8944ed8cf49a18bb0056bcebcdcece385cece4ff" [[package]] name = "pin-utils" @@ -5070,7 +5404,7 @@ dependencies = [ "proc-macro2", "quote", "regex", - "syn 2.0.79", + "syn 2.0.85", ] [[package]] @@ -5249,22 +5583,13 @@ dependencies = [ "toml 0.5.11", ] -[[package]] -name = "proc-macro-crate" -version = "2.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e8366a6159044a37876a2b9817124296703c586a5c92e2c53751fa06d8d43e8" -dependencies = [ - "toml_edit 0.20.7", -] - [[package]] name = "proc-macro-crate" version = "3.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8ecf48c7ca261d60b74ab1a7b20da18bede46776b2e55535cb958eb595c5fa7b" dependencies = [ - "toml_edit 0.22.22", + "toml_edit", ] [[package]] @@ -5325,9 +5650,9 @@ checksum = "dc375e1527247fe1a97d8b7156678dfe7c1af2fc075c9a4db3690ecd2a148068" [[package]] name = "proc-macro2" -version = "1.0.86" +version = "1.0.89" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e719e8df665df0d1c8fbfd238015744736151d4445ec0836b8e628aae103b77" +checksum = "f139b0662de085916d1fb67d2b4169d1addddda1919e696f3252b740b629986e" dependencies = [ "unicode-ident", ] @@ -5352,7 +5677,18 @@ checksum = "440f724eba9f6996b75d63681b0a92b06947f1457076d503a4d2e2c8f56442b8" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.85", +] + +[[package]] +name = "pulldown-cmark" +version = "0.9.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "57206b407293d2bcd3af849ce869d52068623f19e1b5ff8e8778e3309439682b" +dependencies = [ + "bitflags 2.6.0", + "memchr", + "unicase", ] [[package]] @@ -5452,7 +5788,7 @@ dependencies = [ "pin-project-lite", "quinn-proto", "quinn-udp", - "rustc-hash", + "rustc-hash 2.0.0", "rustls", "socket2", "thiserror", @@ -5469,7 +5805,7 @@ dependencies = [ "bytes", "rand", "ring 0.17.8", - "rustc-hash", + "rustc-hash 2.0.0", "rustls", "slab", "thiserror", @@ -5509,12 +5845,6 @@ dependencies = [ "pest_derive", ] -[[package]] -name = "radium" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc33ff2d4973d518d823d61aa239014831e521c75da58e3df4840d3f47749d09" - [[package]] name = "rand" version = "0.8.5" @@ -5545,6 +5875,16 @@ dependencies = [ "getrandom", ] +[[package]] +name = "rand_distr" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32cb0b9bc82b0a0876c2dd994a7e7a2683d3e7390ca40e6886785ef0c7e3ee31" +dependencies = [ + "num-traits", + "rand", +] + [[package]] name = "range-collections" version = "0.4.5" @@ -5559,13 +5899,33 @@ dependencies = [ [[package]] name = "raw-cpuid" -version = "11.1.0" +version = "11.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb9ee317cfe3fbd54b36a511efc1edd42e216903c9cd575e686dd68a2ba90d8d" +checksum = "1ab240315c661615f2ee9f0f2cd32d5a7343a84d5ebcccb99d46e6637565e7b0" dependencies = [ "bitflags 2.6.0", ] +[[package]] +name = "rayon" +version = "1.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b418a60154510ca1a002a752ca9714984e21e4241e804d32555251faf8b78ffa" +dependencies = [ + "either", + "rayon-core", +] + +[[package]] +name = "rayon-core" +version = "1.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1465873a3dfdaa8ae7cb14b4383657caab0b3e8a0aa9ae8e04b044854c8dfce2" +dependencies = [ + "crossbeam-deque", + "crossbeam-utils", +] + [[package]] name = "rcgen" version = "0.11.3" @@ -5615,9 +5975,9 @@ dependencies = [ [[package]] name = "redb" -version = "2.1.3" +version = "2.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e4760ad04a88ef77075ba86ba9ea79b919e6bab29c1764c5747237cd6eaedcaa" +checksum = "074373f3e7e5d27d8741d19512232adb47be8622d3daef3a45bcae72050c3d2a" dependencies = [ "libc", ] @@ -5659,7 +6019,7 @@ checksum = "bcc303e793d3734489387d205e9b186fac9c6cfacedd98cbb2e8a5943595f3e6" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.85", ] [[package]] @@ -5675,14 +6035,23 @@ dependencies = [ [[package]] name = "regex" -version = "1.11.0" +version = "1.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38200e5ee88914975b69f657f0801b6f6dccafd44fd9326302a4aaeecfacb1d8" +checksum = "b544ef1b4eac5dc2db33ea63606ae9ffcfac26c1416a2806ae0bf5f56b201191" dependencies = [ "aho-corasick", "memchr", - "regex-automata", - "regex-syntax", + "regex-automata 0.4.8", + "regex-syntax 0.8.5", +] + +[[package]] +name = "regex-automata" +version = "0.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c230d73fb8d8c1b9c0b3135c5142a8acee3a0558fb8db5cf1cb65f8d7862132" +dependencies = [ + "regex-syntax 0.6.29", ] [[package]] @@ -5693,7 +6062,7 @@ checksum = "368758f23274712b504848e9d5a6f010445cc8b87a7cdb4d7cbee666c1288da3" dependencies = [ "aho-corasick", "memchr", - "regex-syntax", + "regex-syntax 0.8.5", ] [[package]] @@ -5702,6 +6071,12 @@ version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "53a49587ad06b26609c52e423de037e7f57f20d53535d66e08c695f347df952a" +[[package]] +name = "regex-syntax" +version = "0.6.29" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1" + [[package]] name = "regex-syntax" version = "0.8.5" @@ -5721,7 +6096,7 @@ dependencies = [ "http 1.1.0", "http-body 1.0.1", "http-body-util", - "hyper 1.4.1", + "hyper 1.5.0", "hyper-rustls", "hyper-util", "ipnet", @@ -5874,8 +6249,8 @@ dependencies = [ [[package]] name = "rust-ipfs" -version = "0.12.0" -source = "git+https://github.com/dariusc93/rust-ipfs.git?branch=libp2p-next#3bbab8bd72736fb383a2c96dbc01eb809f72ef1f" +version = "0.12.1" +source = "git+https://github.com/dariusc93/rust-ipfs.git?branch=libp2p-next#84c6e4439c550b48bfc9e062bd1baa9e9ea39772" dependencies = [ "anyhow", "async-stream", @@ -5895,6 +6270,7 @@ dependencies = [ "hkdf", "idb", "indexmap", + "instant", "ipld-core", "ipld-dagpb", "libp2p", @@ -5902,9 +6278,9 @@ dependencies = [ "libp2p-connection-limits", "libp2p-relay-manager", "multibase", - "multihash 0.19.1", + "multihash 0.19.2", "multihash-codetable", - "multihash-derive 0.9.0", + "multihash-derive 0.9.1", "p256", "parking_lot", "pem", @@ -5942,7 +6318,7 @@ dependencies = [ [[package]] name = "rust-ipns" version = "0.6.0" -source = "git+https://github.com/dariusc93/rust-ipfs.git?branch=libp2p-next#3bbab8bd72736fb383a2c96dbc01eb809f72ef1f" +source = "git+https://github.com/dariusc93/rust-ipfs.git?branch=libp2p-next#84c6e4439c550b48bfc9e062bd1baa9e9ea39772" dependencies = [ "cbor4ii 0.3.3", "chrono", @@ -5950,24 +6326,34 @@ dependencies = [ "derive_more", "getrandom", "libp2p-identity", - "multihash 0.19.1", + "multihash 0.19.2", "quick-protobuf", "serde", "sha2 0.10.8", ] +[[package]] +name = "rust-stemmers" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e46a2036019fdb888131db7a4c847a1063a7493f971ed94ea82c67eada63ca54" +dependencies = [ + "serde", + "serde_derive", +] + [[package]] name = "rust-unixfs" version = "0.5.0" -source = "git+https://github.com/dariusc93/rust-ipfs.git?branch=libp2p-next#3bbab8bd72736fb383a2c96dbc01eb809f72ef1f" +source = "git+https://github.com/dariusc93/rust-ipfs.git?branch=libp2p-next#84c6e4439c550b48bfc9e062bd1baa9e9ea39772" dependencies = [ "either", "filetime", "ipld-core", "ipld-dagpb", - "multihash 0.19.1", + "multihash 0.19.2", "multihash-codetable", - "multihash-derive 0.9.0", + "multihash-derive 0.9.1", "quick-protobuf", "sha2 0.10.8", ] @@ -5978,6 +6364,12 @@ version = "0.1.24" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f" +[[package]] +name = "rustc-hash" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" + [[package]] name = "rustc-hash" version = "2.0.0" @@ -6017,9 +6409,9 @@ dependencies = [ [[package]] name = "rustls" -version = "0.23.13" +version = "0.23.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f2dabaac7466917e566adb06783a81ca48944c6898a1b08b9374106dd671f4c8" +checksum = "5fbb44d7acc4e873d613422379f69f237a1b141928c02f6bc6ccfddddc2d7993" dependencies = [ "log", "once_cell", @@ -6054,9 +6446,9 @@ dependencies = [ [[package]] name = "rustls-pki-types" -version = "1.9.0" +version = "1.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e696e35370c65c9c541198af4543ccd580cf17fc25d8e05c5a242b202488c55" +checksum = "16f1201b3c9a7ee8039bcadc17b7e605e2945b27eee7631788c1bd2b0643674b" [[package]] name = "rustls-platform-verifier" @@ -6108,9 +6500,9 @@ dependencies = [ [[package]] name = "rustversion" -version = "1.0.17" +version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "955d28af4278de8121b7ebeb796b6a45735dc01436d898801014aced2773a3d6" +checksum = "0e819f2bc632f285be6d7cd36e25940d45b2391dd6d9b939e79de557f7014248" [[package]] name = "rw-stream-sink" @@ -6149,13 +6541,19 @@ dependencies = [ [[package]] name = "schannel" -version = "0.1.24" +version = "0.1.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e9aaafd5a2b6e3d657ff009d82fbd630b6bd54dd4eb06f21693925cdf80f9b8b" +checksum = "01227be5826fa0690321a2ba6c5cd57a19cf3f6a09e76973b58e61de6ab9d1c1" dependencies = [ "windows-sys 0.59.0", ] +[[package]] +name = "scoped-tls" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e1cf6437eb19a8f4a6cc0f7dca544973b0b78843adbfeb3683d1a94a0024a294" + [[package]] name = "scopeguard" version = "1.2.0" @@ -6211,6 +6609,9 @@ name = "semver" version = "1.0.23" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "61697e0a1c7e512e84a621326239844a24d8207b4669b41bc18b32ea5cbf988b" +dependencies = [ + "serde", +] [[package]] name = "send_wrapper" @@ -6229,9 +6630,9 @@ dependencies = [ [[package]] name = "serde" -version = "1.0.210" +version = "1.0.213" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8e3592472072e6e22e0a54d5904d9febf8508f65fb8552499a1abc7d1078c3a" +checksum = "3ea7893ff5e2466df8d720bb615088341b295f849602c6956047f8f80f0e9bc1" dependencies = [ "serde_derive", ] @@ -6286,13 +6687,13 @@ dependencies = [ [[package]] name = "serde_derive" -version = "1.0.210" +version = "1.0.213" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "243902eda00fad750862fc144cea25caca5e20d615af0a81bee94ca738f1df1f" +checksum = "7e85ad2009c50b58e87caa8cd6dac16bdf511bbfb7af6c33df902396aa480fa5" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.85", ] [[package]] @@ -6320,9 +6721,9 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.128" +version = "1.0.132" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ff5456707a1de34e7e37f2a6fd3d3f808c318259cbd01ab6377795054b483d8" +checksum = "d726bfaff4b320266d395898905d0eba0345aae23b54aee3a737e260fd46db03" dependencies = [ "itoa", "memchr", @@ -6412,6 +6813,15 @@ dependencies = [ "keccak", ] +[[package]] +name = "sharded-slab" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f40ca3c46823713e0d4209592e8d6e826aa57e928f09752619fc696c499637f6" +dependencies = [ + "lazy_static", +] + [[package]] name = "shared_child" version = "1.0.1" @@ -6479,6 +6889,30 @@ dependencies = [ "simple_asn1", ] +[[package]] +name = "skeptic" +version = "0.13.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "16d23b015676c90a0f01c197bfdc786c20342c73a0afdda9025adb0bc42940a8" +dependencies = [ + "bytecount", + "cargo_metadata", + "error-chain", + "glob", + "pulldown-cmark", + "tempfile", + "walkdir", +] + +[[package]] +name = "sketches-ddsketch" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85636c14b73d81f541e525f585c0a2109e6744e1565b5c1668e31c70c10ed65c" +dependencies = [ + "serde", +] + [[package]] name = "slab" version = "0.4.9" @@ -6634,9 +7068,9 @@ dependencies = [ [[package]] name = "ssh-key" -version = "0.6.6" +version = "0.6.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca9b366a80cf18bb6406f4cf4d10aebfb46140a8c0c33f666a144c5c76ecbafc" +checksum = "3b86f5297f0f04d08cabaa0f6bff7cb6aec4d9c3b49d87990d63da9d9156a8c3" dependencies = [ "ed25519-dalek", "p256", @@ -6653,6 +7087,12 @@ dependencies = [ "zeroize", ] +[[package]] +name = "stable_deref_trait" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" + [[package]] name = "static_assertions" version = "1.1.0" @@ -6661,9 +7101,9 @@ checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" [[package]] name = "strobe-rs" -version = "0.8.1" +version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fabb238a1cccccfa4c4fb703670c0d157e1256c1ba695abf1b93bd2bb14bab2d" +checksum = "98fe17535ea31344936cc58d29fec9b500b0452ddc4cc24c429c8a921a0e84e5" dependencies = [ "bitflags 1.3.2", "byteorder", @@ -6672,12 +7112,6 @@ dependencies = [ "zeroize", ] -[[package]] -name = "strsim" -version = "0.11.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" - [[package]] name = "struct_iterable" version = "0.1.1" @@ -6698,7 +7132,7 @@ dependencies = [ "proc-macro2", "quote", "struct_iterable_internal", - "syn 2.0.79", + "syn 2.0.85", ] [[package]] @@ -6741,7 +7175,7 @@ dependencies = [ "proc-macro2", "quote", "rustversion", - "syn 2.0.79", + "syn 2.0.85", ] [[package]] @@ -6754,14 +7188,14 @@ dependencies = [ "proc-macro2", "quote", "rustversion", - "syn 2.0.79", + "syn 2.0.85", ] [[package]] name = "stun-rs" -version = "0.1.8" +version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0adebf9fb8fba5c39ee34092b0383f247e4d1255b98fcffec94b4b797b85b677" +checksum = "b79cc624c9a747353810310af44f1f03f71eb4561284a894acc0396e6d0de76e" dependencies = [ "base64 0.22.1", "bounded-integer", @@ -6852,9 +7286,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.79" +version = "2.0.85" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89132cd0bf050864e1d38dc3bbc07a0eb8e7530af26344d3d2bbbef83499f590" +checksum = "5023162dfcd14ef8f32034d8bcd4cc5ddc61ef7a247c024a33e24e1f24d21b56" dependencies = [ "proc-macro2", "quote", @@ -6901,7 +7335,7 @@ checksum = "c8af7666ab7b6390ab78131fb5b0fce11d6b7a6951602017c35fa82800708971" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.85", ] [[package]] @@ -6960,10 +7394,145 @@ dependencies = [ ] [[package]] -name = "tap" -version = "1.0.1" +name = "tantivy" +version = "0.22.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8d0582f186c0a6d55655d24543f15e43607299425c5ad8352c242b914b31856" +dependencies = [ + "aho-corasick", + "arc-swap", + "base64 0.22.1", + "bitpacking", + "byteorder", + "census", + "crc32fast", + "crossbeam-channel", + "downcast-rs", + "fastdivide", + "fnv", + "fs4", + "htmlescape", + "itertools 0.12.1", + "levenshtein_automata", + "log", + "lru", + "lz4_flex", + "measure_time", + "memmap2", + "num_cpus", + "once_cell", + "oneshot", + "rayon", + "regex", + "rust-stemmers", + "rustc-hash 1.1.0", + "serde", + "serde_json", + "sketches-ddsketch", + "smallvec", + "tantivy-bitpacker", + "tantivy-columnar", + "tantivy-common", + "tantivy-fst", + "tantivy-query-grammar", + "tantivy-stacker", + "tantivy-tokenizer-api", + "tempfile", + "thiserror", + "time", + "uuid", + "winapi", +] + +[[package]] +name = "tantivy-bitpacker" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "284899c2325d6832203ac6ff5891b297fc5239c3dc754c5bc1977855b23c10df" +dependencies = [ + "bitpacking", +] + +[[package]] +name = "tantivy-columnar" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369" +checksum = "12722224ffbe346c7fec3275c699e508fd0d4710e629e933d5736ec524a1f44e" +dependencies = [ + "downcast-rs", + "fastdivide", + "itertools 0.12.1", + "serde", + "tantivy-bitpacker", + "tantivy-common", + "tantivy-sstable", + "tantivy-stacker", +] + +[[package]] +name = "tantivy-common" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8019e3cabcfd20a1380b491e13ff42f57bb38bf97c3d5fa5c07e50816e0621f4" +dependencies = [ + "async-trait", + "byteorder", + "ownedbytes", + "serde", + "time", +] + +[[package]] +name = "tantivy-fst" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d60769b80ad7953d8a7b2c70cdfe722bbcdcac6bccc8ac934c40c034d866fc18" +dependencies = [ + "byteorder", + "regex-syntax 0.8.5", + "utf8-ranges", +] + +[[package]] +name = "tantivy-query-grammar" +version = "0.22.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "847434d4af57b32e309f4ab1b4f1707a6c566656264caa427ff4285c4d9d0b82" +dependencies = [ + "nom", +] + +[[package]] +name = "tantivy-sstable" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c69578242e8e9fc989119f522ba5b49a38ac20f576fc778035b96cc94f41f98e" +dependencies = [ + "tantivy-bitpacker", + "tantivy-common", + "tantivy-fst", + "zstd", +] + +[[package]] +name = "tantivy-stacker" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c56d6ff5591fc332739b3ce7035b57995a3ce29a93ffd6012660e0949c956ea8" +dependencies = [ + "murmurhash32", + "rand_distr", + "tantivy-common", +] + +[[package]] +name = "tantivy-tokenizer-api" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2a0dcade25819a89cfe6f17d932c9cedff11989936bf6dd4f336d50392053b04" +dependencies = [ + "serde", +] [[package]] name = "target-lexicon" @@ -7007,22 +7576,32 @@ dependencies = [ [[package]] name = "thiserror" -version = "1.0.64" +version = "1.0.65" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d50af8abc119fb8bb6dbabcfa89656f46f84aa0ac7688088608076ad2b459a84" +checksum = "5d11abd9594d9b38965ef50805c5e469ca9cc6f197f883f717e0269a3057b3d5" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.64" +version = "1.0.65" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08904e7672f5eb876eaaf87e0ce17857500934f4981c4a0ab2b4aa98baac7fc3" +checksum = "ae71770322cbd277e69d762a16c444af02aa0575ac0d174f0b9562d3b37f8602" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.85", +] + +[[package]] +name = "thread_local" +version = "1.1.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b9ef9bad013ada3808854ceac7b46812a6465ba368859a37e2100283d2d719c" +dependencies = [ + "cfg-if", + "once_cell", ] [[package]] @@ -7082,9 +7661,9 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.40.0" +version = "1.41.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2b070231665d27ad9ec9b8df639893f46727666c6767db40317fbe920a5d998" +checksum = "145f3413504347a2be84393cc8a7d2fb4d863b375909ea59f2158261aa258bbb" dependencies = [ "backtrace", "bytes", @@ -7106,7 +7685,7 @@ checksum = "693d596312e88961bc67d7f1f97af8a70227d9f90c31bba5806eec004978d752" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.85", ] [[package]] @@ -7188,7 +7767,7 @@ dependencies = [ "futures-io", "futures-sink", "futures-util", - "hashbrown", + "hashbrown 0.14.5", "pin-project-lite", "slab", "tokio", @@ -7212,7 +7791,7 @@ dependencies = [ "serde", "serde_spanned", "toml_datetime", - "toml_edit 0.22.22", + "toml_edit", ] [[package]] @@ -7224,17 +7803,6 @@ dependencies = [ "serde", ] -[[package]] -name = "toml_edit" -version = "0.20.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70f427fce4d84c72b5b732388bf4a9f4531b53f74e2887e3ecb2481f68f66d81" -dependencies = [ - "indexmap", - "toml_datetime", - "winnow 0.5.40", -] - [[package]] name = "toml_edit" version = "0.22.22" @@ -7245,7 +7813,7 @@ dependencies = [ "serde", "serde_spanned", "toml_datetime", - "winnow 0.6.20", + "winnow", ] [[package]] @@ -7274,7 +7842,7 @@ checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.85", ] [[package]] @@ -7284,6 +7852,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c06d3da6113f116aaee68e4d601191614c9053067f9ab7f6edbcb161237daa54" dependencies = [ "once_cell", + "valuable", ] [[package]] @@ -7298,20 +7867,48 @@ dependencies = [ "tracing", ] +[[package]] +name = "tracing-log" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ee855f1f400bd0e5c02d150ae5de3840039a3f54b025156404e34c23c03f47c3" +dependencies = [ + "log", + "once_cell", + "tracing-core", +] + +[[package]] +name = "tracing-subscriber" +version = "0.3.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ad0f048c97dbd9faa9b7df56362b8ebcaa52adb06b498c050d2f4e32f90a7a8b" +dependencies = [ + "matchers", + "nu-ansi-term", + "once_cell", + "regex", + "sharded-slab", + "smallvec", + "thread_local", + "tracing", + "tracing-core", + "tracing-log", +] + [[package]] name = "tree_magic_db" -version = "3.0.0" +version = "3.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e73fc24a5427b3b15e2b0bcad8ef61b5affb1da8ac89c8bf3f196c8692d57f02" +checksum = "bd30f22e7532ed0d3d846e24841a132c8dcb779f5b497bda82d904aa04755375" [[package]] name = "tree_magic_mini" -version = "3.1.5" +version = "3.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "469a727cac55b41448315cc10427c069c618ac59bb6a4480283fcd811749bdc2" +checksum = "aac5e8971f245c3389a5a76e648bfc80803ae066a1243a75db0064d7c1129d63" dependencies = [ "fnv", - "home", "memchr", "nom", "once_cell", @@ -7413,11 +8010,17 @@ dependencies = [ "static_assertions", ] +[[package]] +name = "unicase" +version = "2.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7e51b68083f157f853b6379db119d1c1be0e6e4dec98101079dec41f6f5cf6df" + [[package]] name = "unicode-bidi" -version = "0.3.15" +version = "0.3.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08f95100a766bf4f8f28f90d77e0a5461bbdb219042e7679bebe79004fed8d75" +checksum = "5ab17db44d7388991a428b2ee655ce0c212e862eff1768a455c58f9aad6e7893" [[package]] name = "unicode-ident" @@ -7529,6 +8132,12 @@ version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "09cc8ee72d2a9becf2f2febe0205bbed8fc6615b7cb429ad062dc7b7ddd036a9" +[[package]] +name = "utf8-ranges" +version = "1.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7fcfc827f90e53a02eaef5e535ee14266c1d569214c6aa70133a624d8a3164ba" + [[package]] name = "utf8-width" version = "0.1.7" @@ -7543,15 +8152,21 @@ checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821" [[package]] name = "uuid" -version = "1.10.0" +version = "1.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81dfa00651efa65069b0b6b651f4aaa31ba9e3c3ce0137aaad053604ee7e0314" +checksum = "f8c5f0a0af699448548ad1a2fbf920fb4bee257eae39953ba95cb84891a0446a" dependencies = [ "getrandom", "rand", "serde", ] +[[package]] +name = "valuable" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "830b7e5d4d90034032940e4ace0d9a9a057e7a45cd94e6c007832e39edb82f6d" + [[package]] name = "version-compare" version = "0.2.0" @@ -7603,9 +8218,9 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "wasm-bindgen" -version = "0.2.93" +version = "0.2.95" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a82edfc16a6c469f5f44dc7b571814045d60404b55a0ee849f9bcfa2e63dd9b5" +checksum = "128d1e363af62632b8eb57219c8fd7877144af57558fb2ef0368d0087bddeb2e" dependencies = [ "cfg-if", "once_cell", @@ -7614,24 +8229,24 @@ dependencies = [ [[package]] name = "wasm-bindgen-backend" -version = "0.2.93" +version = "0.2.95" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9de396da306523044d3302746f1208fa71d7532227f15e347e2d93e4145dd77b" +checksum = "cb6dd4d3ca0ddffd1dd1c9c04f94b868c37ff5fac97c30b97cff2d74fce3a358" dependencies = [ "bumpalo", "log", "once_cell", "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.85", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-futures" -version = "0.4.43" +version = "0.4.45" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61e9300f63a621e96ed275155c108eb6f843b6a26d053f122ab69724559dc8ed" +checksum = "cc7ec4f8827a71586374db3e87abdb5a2bb3a15afed140221307c3ec06b1f63b" dependencies = [ "cfg-if", "js-sys", @@ -7641,9 +8256,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.93" +version = "0.2.95" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "585c4c91a46b072c92e908d99cb1dcdf95c5218eeb6f3bf1efa991ee7a68cccf" +checksum = "e79384be7f8f5a9dd5d7167216f022090cf1f9ec128e6e6a482a2cb5c5422c56" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -7651,22 +8266,22 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.93" +version = "0.2.95" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "afc340c74d9005395cf9dd098506f7f44e38f2b4a21c6aaacf9a105ea5e1e836" +checksum = "26c6ab57572f7a24a4985830b120de1594465e5d500f24afe89e16b4e833ef68" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.85", "wasm-bindgen-backend", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-shared" -version = "0.2.93" +version = "0.2.95" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c62a0a307cb4a311d3a07867860911ca130c3494e8c2719593806c08bc5d0484" +checksum = "65fc09f10666a9f147042251e0dda9c18f166ff7de300607007e96bdebc1068d" [[package]] name = "watchable" @@ -7682,9 +8297,9 @@ dependencies = [ [[package]] name = "web-sys" -version = "0.3.70" +version = "0.3.72" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26fdeaafd9bd129f65e7c031593c24d62186301e0c72c8978fa1678be7d532c0" +checksum = "f6488b90108c040df0fe62fa815cbdee25124641df01814dd7282749234c6112" dependencies = [ "js-sys", "wasm-bindgen", @@ -7785,6 +8400,15 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" +[[package]] +name = "windows" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e686886bc078bc1b0b600cac0147aadb815089b6e4da64016cbd754b6342700f" +dependencies = [ + "windows-targets 0.48.5", +] + [[package]] name = "windows" version = "0.51.1" @@ -7844,7 +8468,7 @@ checksum = "2bbd5b46c938e506ecbce286b6628a02171d56153ba733b6c741fc627ec9579b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.85", ] [[package]] @@ -7855,7 +8479,7 @@ checksum = "053c4c462dc91d3b1504c6fe5a726dd15e216ba718e84a0e46a88fbe5ded3515" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.85", ] [[package]] @@ -8036,15 +8660,6 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" -[[package]] -name = "winnow" -version = "0.5.40" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f593a95398737aeed53e489c785df13f3618e41dbcd6718c6addbf1395aa6876" -dependencies = [ - "memchr", -] - [[package]] name = "winnow" version = "0.6.20" @@ -8079,15 +8694,6 @@ dependencies = [ "windows-core 0.58.0", ] -[[package]] -name = "wyz" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05f360fc0b24296329c78fda852a1e9ae82de9cf7b27dae4b7f62f118f77b9ed" -dependencies = [ - "tap", -] - [[package]] name = "x25519-dalek" version = "2.0.1" @@ -8199,6 +8805,15 @@ dependencies = [ "zerocopy-derive 0.7.35", ] +[[package]] +name = "zerocopy" +version = "0.8.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bb3da5f7220f919a6c7af7c856435a68ee1582fd7a77aa72936257d8335bd6f6" +dependencies = [ + "zerocopy-derive 0.8.7", +] + [[package]] name = "zerocopy-derive" version = "0.6.6" @@ -8207,7 +8822,7 @@ checksum = "125139de3f6b9d625c39e2efdd73d41bdac468ccd556556440e322be0e1bbd91" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.85", ] [[package]] @@ -8218,7 +8833,18 @@ checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.85", +] + +[[package]] +name = "zerocopy-derive" +version = "0.8.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2e5f54f3cc93cd80745404626681b4b9fca9a867bad5a8424b618eb0db1ae6ea" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.85", ] [[package]] @@ -8238,5 +8864,33 @@ checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.85", +] + +[[package]] +name = "zstd" +version = "0.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fcf2b778a664581e31e389454a7072dab1647606d44f7feea22cd5abb9c9f3f9" +dependencies = [ + "zstd-safe", +] + +[[package]] +name = "zstd-safe" +version = "7.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "54a3ab4db68cea366acc5c897c7b4d4d1b8994a9cd6e6f841f8964566a419059" +dependencies = [ + "zstd-sys", +] + +[[package]] +name = "zstd-sys" +version = "2.0.13+zstd.1.5.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "38ff0f21cfee8f97d94cef41359e0c89aa6113028ab0291aa8ca0038995a95aa" +dependencies = [ + "cc", + "pkg-config", ] diff --git a/Cargo.toml b/Cargo.toml index 87b75fc1..b5f341f8 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -32,7 +32,7 @@ bincode = "1.3.3" chrono = { version = "0.4.38", features = ["unstable-locales", "serde"] } cid = "0.11.1" directories-next = "2.0.0" -futures = "0.3.30" +futures = "0.3.31" gdk = { version = "*", package = "gdk4", features = ["v4_14"] } gio = { version = "*", features = ["v2_80"] } glib = { version = "*", features = ["v2_80"] } @@ -40,31 +40,33 @@ glib-macros = { version = "*" } gtk = { version = "*", package = "gtk4", features = ["gnome_46"], default-features = false } ipfs = { git = "https://github.com/dariusc93/rust-ipfs.git", branch = "libp2p-next", package = "rust-ipfs"} lazy_static = "1.5.0" -libadwaita = { version = "*", features = ["v1_5", "gio_v2_80"] } +libadwaita = { version = "*", features = ["v1_6", "gio_v2_80"] } oku-fs = { git = "https://github.com/OkuBrowser/oku-fs", features = ["fuse"] } # oku-fs = { path = "/home/emil/Documents/GitHub/oku-fs", features = ["fuse"] } pango = { version = "*" } url = "2.5.2" -tokio = { version = "1.40.0", features = ["full"] } +tokio = { version = "1.41.0", features = ["full"] } tokio-stream = "0.1.16" webkit2gtk = { version = "*", package = "webkit6", features = ["v2_44"] } -tree_magic_mini = { version = "3.1.5", features = ["with-gpl-data"] } +tree_magic_mini = { version = "3.1.6", features = ["with-gpl-data"] } open = "5.3.0" env_logger = "0.11.5" log = "0.4.22" toml = "0.8.19" -serde = "1.0.210" -uuid = { version = "1.10.0", features = ["v4", "fast-rng", "serde"] } +serde = "1.0.213" +uuid = { version = "1.11.0", features = ["v7", "fast-rng", "serde"] } miette = "7.2.0" glob = "0.3.1" liquid = "0.26.9" liquid-core = "0.26.9" liquid-lib = { version = "0.26.9", features = ["all", "stdlib", "jekyll", "shopify", "extra"] } -daggy = { version = "0.8.0", features = ["stable_dag", "serde-1"] } -indicium = { version = "0.6.2", features = ["simple", "strsim", "ahash", "serde"], default-features = false } -once_cell = "1.19.0" +once_cell = "1.20.2" html-escape = "0.2.13" -bytes = "1.7.2" +bytes = "1.8.0" +native_db = "0.8.1" +native_model = "0.4.20" +rayon = "1.10.0" +tantivy = "0.22.0" [profile.release] codegen-units = 1 diff --git a/build-aux/com.github.OkuBrowser.json b/build-aux/com.github.OkuBrowser.json index b9cfa8dc..3c6ded14 100644 --- a/build-aux/com.github.OkuBrowser.json +++ b/build-aux/com.github.OkuBrowser.json @@ -14,12 +14,10 @@ "--socket=wayland", "--device=all", "--socket=pulseaudio", + "--socket=cups", "--filesystem=xdg-download", "--filesystem=xdg-pictures", - "--filesystem=host", - "--talk-name=org.freedesktop.Flatpak", - "--talk-name=org.freedesktop.FileManager1", - "--talk-name=org.freedesktop.Notifications" + "--filesystem=host" ], "cleanup": [ "/include", @@ -63,6 +61,7 @@ "cargo --offline fetch --manifest-path Cargo.toml --verbose", "cargo --offline build --release --verbose", "install -Dm755 ./target/release/oku -t /app/bin/", + "install -Dm755 ./resources.gresource -t /app/bin/", "install -Dm644 ./data/${FLATPAK_ID}.metainfo.xml -t /app/share/metainfo/", "install -Dm644 ./data/${FLATPAK_ID}.desktop -t /app/share/applications/", "mkdir -p /app/share/icons/hicolor", diff --git a/data/com.github.OkuBrowser.desktop b/data/com.github.OkuBrowser.desktop index 91726af1..3ec840aa 100644 --- a/data/com.github.OkuBrowser.desktop +++ b/data/com.github.OkuBrowser.desktop @@ -4,7 +4,6 @@ Name=Oku GenericName=Web Browser Comment=A Web browser with an emphasis on local-first data storage Type=Application -TryExec=oku Exec=oku %U Terminal=false Categories=Network;WebBrowser;GTK;GNOME; diff --git a/data/hicolor/scalable/actions/copy-symbolic.svg b/data/hicolor/scalable/actions/copy-symbolic.svg new file mode 100644 index 00000000..7aad5a3e --- /dev/null +++ b/data/hicolor/scalable/actions/copy-symbolic.svg @@ -0,0 +1,2 @@ + + diff --git a/data/hicolor/scalable/actions/hourglass-symbolic.svg b/data/hicolor/scalable/actions/hourglass-symbolic.svg new file mode 100644 index 00000000..f9d6e9ff --- /dev/null +++ b/data/hicolor/scalable/actions/hourglass-symbolic.svg @@ -0,0 +1,2 @@ + + diff --git a/data/hicolor/scalable/actions/ticket-special-symbolic.svg b/data/hicolor/scalable/actions/ticket-special-symbolic.svg new file mode 100644 index 00000000..6a8b33fe --- /dev/null +++ b/data/hicolor/scalable/actions/ticket-special-symbolic.svg @@ -0,0 +1,2 @@ + + diff --git a/data/hicolor/scalable/actions/ticket-symbolic.svg b/data/hicolor/scalable/actions/ticket-symbolic.svg new file mode 100644 index 00000000..6f2cf45e --- /dev/null +++ b/data/hicolor/scalable/actions/ticket-symbolic.svg @@ -0,0 +1,2 @@ + + diff --git a/resources.gresource.xml b/resources.gresource.xml index 0f4a694f..42250054 100644 --- a/resources.gresource.xml +++ b/resources.gresource.xml @@ -13,5 +13,9 @@ update-symbolic.svg uppercase-symbolic.svg user-trash-symbolic.svg + hourglass-symbolic.svg + ticket-special-symbolic.svg + ticket-symbolic.svg + copy-symbolic.svg \ No newline at end of file diff --git a/src/browser_pages/snippets/style.css b/src/browser_pages/snippets/style.css index 27c1aa70..b9cc5f66 100644 --- a/src/browser_pages/snippets/style.css +++ b/src/browser_pages/snippets/style.css @@ -107,7 +107,7 @@ } :root { - --body-bg: linear-gradient(var(--light-2), color-mix(in srgb, var(--grey) 25%, var(--light-2))); + --body-bg: linear-gradient(transparent, color-mix(in srgb, var(--grey) 25%, transparent)); --body-color: var(--dark-3); --link-color: color-mix(in srgb, var(--pink) 80%, var(--purple)); --link-hover-color: color-mix(in srgb, color-mix(in srgb, var(--pink) 80%, var(--purple)), black 35%); @@ -118,7 +118,7 @@ @media (prefers-color-scheme: dark) { :root { - --body-bg: linear-gradient(color-mix(in srgb, var(--grey), var(--dark-4) 90%), var(--dark-4)); + --body-bg: linear-gradient(color-mix(in srgb, var(--grey), transparent 90%), transparent); --body-color: var(--light-2); --link-color: color-mix(in srgb, var(--orange) 80%, var(--yellow)); --link-hover-color: color-mix(in srgb, color-mix(in srgb, var(--orange) 80%, var(--yellow)) 90%, white); diff --git a/src/database/bookmark.rs b/src/database/bookmark.rs new file mode 100644 index 00000000..ded89023 --- /dev/null +++ b/src/database/bookmark.rs @@ -0,0 +1,238 @@ +use super::{BrowserDatabase, DATABASE}; +use miette::IntoDiagnostic; +use native_db::*; +use native_model::{native_model, Model}; +use oku_fs::{database::OkuNote, fs::FS_PATH}; +use rayon::iter::{IntoParallelIterator, IntoParallelRefIterator, ParallelIterator}; +use serde::{Deserialize, Serialize}; +use std::{ + collections::HashMap, + path::PathBuf, + sync::{Arc, LazyLock}, +}; +use tantivy::{ + collector::TopDocs, + directory::MmapDirectory, + query::QueryParser, + schema::{Field, Schema, Value, TEXT}, + Directory, Index, IndexReader, IndexWriter, TantivyDocument, Term, +}; +use tokio::sync::Mutex; + +pub(crate) static BOOKMARK_INDEX_PATH: LazyLock = + LazyLock::new(|| PathBuf::from(FS_PATH).join("BOOKMARK_INDEX")); +pub(crate) static BOOKMARK_SCHEMA: LazyLock<(Schema, HashMap<&str, Field>)> = LazyLock::new(|| { + let mut schema_builder = Schema::builder(); + let fields = HashMap::from([ + ("url", schema_builder.add_text_field("url", TEXT)), + ("title", schema_builder.add_text_field("title", TEXT)), + ("body", schema_builder.add_text_field("body", TEXT)), + ("tag", schema_builder.add_text_field("tag", TEXT)), + ]); + let schema = schema_builder.build(); + (schema, fields) +}); +pub(crate) static BOOKMARK_INDEX: LazyLock = LazyLock::new(|| { + let _ = std::fs::create_dir_all(&*BOOKMARK_INDEX_PATH); + let mmap_directory: Box = + Box::new(MmapDirectory::open(&*BOOKMARK_INDEX_PATH).unwrap()); + Index::open_or_create(mmap_directory, BOOKMARK_SCHEMA.0.clone()).unwrap() +}); +pub(crate) static BOOKMARK_INDEX_READER: LazyLock = + LazyLock::new(|| BOOKMARK_INDEX.reader().unwrap()); +pub(crate) static BOOKMARK_INDEX_WRITER: LazyLock>> = + LazyLock::new(|| Arc::new(Mutex::new(BOOKMARK_INDEX.writer(50_000_000).unwrap()))); + +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)] +#[native_model(id = 2, version = 1)] +#[native_db] +pub struct Bookmark { + #[primary_key] + pub url: String, + pub title: String, + pub body: String, + pub tags: Vec, +} + +impl Bookmark { + fn index_term(&self) -> Term { + Term::from_field_text(BOOKMARK_SCHEMA.1["url"], &self.url) + } +} + +impl TryFrom for OkuNote { + type Error = miette::Report; + + fn try_from(value: Bookmark) -> Result { + Ok(OkuNote { + url: url::Url::parse(&value.url).into_diagnostic()?, + title: value.title, + body: value.body, + tags: value.tags, + }) + } +} + +impl From for Bookmark { + fn from(value: OkuNote) -> Self { + Self { + url: value.url.to_string(), + title: value.title, + body: value.body, + tags: value.tags, + } + } +} + +impl From for TantivyDocument { + fn from(value: Bookmark) -> Self { + let mut doc = TantivyDocument::default(); + doc.add_text(BOOKMARK_SCHEMA.1["url"], value.url); + doc.add_text(BOOKMARK_SCHEMA.1["title"], value.title); + doc.add_text(BOOKMARK_SCHEMA.1["body"], value.body); + for tag in value.tags { + doc.add_text(BOOKMARK_SCHEMA.1["tag"], tag); + } + doc + } +} + +impl TryFrom for Bookmark { + type Error = miette::Report; + + fn try_from(value: TantivyDocument) -> Result { + let url = value + .get_first(BOOKMARK_SCHEMA.1["url"]) + .ok_or(miette::miette!("No URL for document in index … "))? + .as_str() + .ok_or(miette::miette!("No URL for document in index … "))? + .to_string(); + DATABASE + .get_bookmark(url.clone()) + .ok() + .flatten() + .ok_or(miette::miette!("No bookmark with URL {} found … ", url)) + } +} + +impl BrowserDatabase { + pub fn search_bookmarks( + query_string: String, + result_limit: Option, + ) -> miette::Result> { + let searcher = BOOKMARK_INDEX_READER.searcher(); + let query_parser = QueryParser::for_index( + &*BOOKMARK_INDEX, + BOOKMARK_SCHEMA.1.clone().into_values().collect(), + ); + let query = query_parser.parse_query(&query_string).into_diagnostic()?; + let limit = result_limit.unwrap_or(10); + let top_docs = searcher + .search(&query, &TopDocs::with_limit(limit)) + .into_diagnostic()?; + Ok(top_docs + .par_iter() + .filter_map(|x| searcher.doc(x.1).ok()) + .collect::>() + .into_par_iter() + .filter_map(|x| TryInto::try_into(x).ok()) + .collect()) + } + + pub fn upsert_bookmark(&self, bookmark: Bookmark) -> miette::Result> { + let rw: transaction::RwTransaction<'_> = + self.database.rw_transaction().into_diagnostic()?; + let old_value: Option = rw.upsert(bookmark.clone()).into_diagnostic()?; + rw.commit().into_diagnostic()?; + + let mut index_writer = BOOKMARK_INDEX_WRITER + .clone() + .try_lock_owned() + .into_diagnostic()?; + if let Some(old_bookmark) = old_value.clone() { + index_writer.delete_term(old_bookmark.index_term()); + } + index_writer + .add_document(bookmark.into()) + .into_diagnostic()?; + index_writer.commit().into_diagnostic()?; + + Ok(old_value) + } + + pub fn upsert_bookmarks( + &self, + bookmarks: Vec, + ) -> miette::Result>> { + let rw = self.database.rw_transaction().into_diagnostic()?; + let old_bookmarks: Vec<_> = bookmarks + .into_iter() + .filter_map(|bookmark| rw.upsert(bookmark).ok()) + .collect(); + rw.commit().into_diagnostic()?; + + let mut index_writer = BOOKMARK_INDEX_WRITER + .clone() + .try_lock_owned() + .into_diagnostic()?; + old_bookmarks.par_iter().for_each(|old_bookmark| { + if let Some(old_bookmark) = old_bookmark { + index_writer.delete_term(old_bookmark.index_term()); + } + }); + index_writer.commit().into_diagnostic()?; + + Ok(old_bookmarks) + } + + pub fn delete_bookmark(&self, bookmark: Bookmark) -> miette::Result { + let rw = self.database.rw_transaction().into_diagnostic()?; + let removed_bookmark = rw.remove(bookmark).into_diagnostic()?; + rw.commit().into_diagnostic()?; + + let mut index_writer = BOOKMARK_INDEX_WRITER + .clone() + .try_lock_owned() + .into_diagnostic()?; + index_writer.delete_term(removed_bookmark.index_term()); + index_writer.commit().into_diagnostic()?; + + Ok(removed_bookmark) + } + + pub fn delete_bookmarks(&self, bookmarks: Vec) -> miette::Result> { + let rw = self.database.rw_transaction().into_diagnostic()?; + let removed_bookmarks: Vec<_> = bookmarks + .into_iter() + .filter_map(|bookmark| rw.remove(bookmark).ok()) + .collect(); + rw.commit().into_diagnostic()?; + + let mut index_writer = BOOKMARK_INDEX_WRITER + .clone() + .try_lock_owned() + .into_diagnostic()?; + removed_bookmarks.par_iter().for_each(|removed_bookmark| { + index_writer.delete_term(removed_bookmark.index_term()); + }); + index_writer.commit().into_diagnostic()?; + + Ok(removed_bookmarks) + } + + pub fn get_bookmarks(&self) -> miette::Result> { + let r = self.database.r_transaction().into_diagnostic()?; + Ok(r.scan() + .primary() + .into_diagnostic()? + .all() + .into_diagnostic()? + .collect::, _>>() + .into_diagnostic()?) + } + + pub fn get_bookmark(&self, original_uri: String) -> miette::Result> { + let r = self.database.r_transaction().into_diagnostic()?; + Ok(r.get().primary(original_uri).into_diagnostic()?) + } +} diff --git a/src/database/core.rs b/src/database/core.rs new file mode 100644 index 00000000..1feee907 --- /dev/null +++ b/src/database/core.rs @@ -0,0 +1,65 @@ +use super::*; +use crate::{suggestion_item::SuggestionItem, DATA_DIR}; +use miette::IntoDiagnostic; +use native_db::*; +use oku_fs::database::OkuDatabase; +use std::{path::PathBuf, sync::LazyLock}; +use webkit2gtk::FaviconDatabase; + +pub(crate) static DATABASE_PATH: LazyLock = LazyLock::new(|| DATA_DIR.join("database")); +pub(crate) static DATABASE: LazyLock = + LazyLock::new(|| BrowserDatabase::new().unwrap()); +pub(crate) static MODELS: LazyLock = LazyLock::new(|| { + let mut models = Models::new(); + models.define::().unwrap(); + models.define::().unwrap(); + models +}); + +pub struct BrowserDatabase { + pub(super) database: Database<'static>, + pub history_sender: tokio::sync::watch::Sender<()>, +} + +impl BrowserDatabase { + pub fn new() -> miette::Result { + Ok(Self { + database: native_db::Builder::new() + .create(&MODELS, &*DATABASE_PATH) + .into_diagnostic()?, + history_sender: tokio::sync::watch::channel(()).0, + }) + } + + pub fn search( + &self, + query_string: String, + favicon_database: &FaviconDatabase, + ) -> miette::Result> { + let history_records = Self::search_history_records(query_string.clone(), None)?; + let bookmarks = Self::search_bookmarks(query_string.clone(), None)?; + let okunet_posts = OkuDatabase::search_posts(query_string.clone(), None)?; + + let history_record_suggestions: Vec<_> = history_records + .into_iter() + .map(|x| { + SuggestionItem::new(x.title.unwrap_or(String::new()), x.uri, &favicon_database) + }) + .collect(); + let bookmark_suggestions = bookmarks + .into_iter() + .map(|x| SuggestionItem::new(x.title, x.url, &favicon_database)) + .collect(); + let okunet_post_suggestions = okunet_posts + .into_iter() + .map(|x| SuggestionItem::new(x.note.title, x.note.url.to_string(), &favicon_database)) + .collect(); + + Ok(vec![ + history_record_suggestions, + bookmark_suggestions, + okunet_post_suggestions, + ] + .concat()) + } +} diff --git a/src/database/history_record.rs b/src/database/history_record.rs new file mode 100644 index 00000000..c4c2d5fe --- /dev/null +++ b/src/database/history_record.rs @@ -0,0 +1,267 @@ +use super::{BrowserDatabase, DATABASE}; +use miette::IntoDiagnostic; +use native_db::*; +use native_model::{native_model, Model}; +use oku_fs::fs::FS_PATH; +use rayon::iter::{IntoParallelIterator, IntoParallelRefIterator, ParallelIterator}; +use serde::{Deserialize, Serialize}; +use std::{ + cmp::Reverse, + collections::HashMap, + path::PathBuf, + sync::{Arc, LazyLock}, +}; +use tantivy::{ + collector::TopDocs, + directory::MmapDirectory, + query::QueryParser, + schema::{Field, Schema, Value, FAST, STORED, TEXT}, + Directory, Index, IndexReader, IndexWriter, TantivyDocument, Term, +}; +use tokio::sync::Mutex; +use uuid::Uuid; + +pub(crate) static HISTORY_RECORD_INDEX_PATH: LazyLock = + LazyLock::new(|| PathBuf::from(FS_PATH).join("HISTORY_RECORD_INDEX")); +pub(crate) static HISTORY_RECORD_SCHEMA: LazyLock<(Schema, HashMap<&str, Field>)> = + LazyLock::new(|| { + let mut schema_builder = Schema::builder(); + let fields = HashMap::from([ + ("id", schema_builder.add_text_field("id", STORED)), + ( + "original_uri", + schema_builder.add_text_field("original_uri", TEXT | STORED), + ), + ("uri", schema_builder.add_text_field("uri", TEXT | STORED)), + ( + "title", + schema_builder.add_text_field("title", TEXT | STORED), + ), + ( + "timestamp", + schema_builder.add_date_field("timestamp", FAST), + ), + ]); + let schema = schema_builder.build(); + (schema, fields) + }); +pub(crate) static HISTORY_RECORD_INDEX: LazyLock = LazyLock::new(|| { + let _ = std::fs::create_dir_all(&*HISTORY_RECORD_INDEX_PATH); + let mmap_directory: Box = + Box::new(MmapDirectory::open(&*HISTORY_RECORD_INDEX_PATH).unwrap()); + Index::open_or_create(mmap_directory, HISTORY_RECORD_SCHEMA.0.clone()).unwrap() +}); +pub(crate) static HISTORY_RECORD_INDEX_READER: LazyLock = + LazyLock::new(|| HISTORY_RECORD_INDEX.reader().unwrap()); +pub(crate) static HISTORY_RECORD_INDEX_WRITER: LazyLock>> = + LazyLock::new(|| Arc::new(Mutex::new(HISTORY_RECORD_INDEX.writer(50_000_000).unwrap()))); + +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)] +#[native_model(id = 1, version = 1)] +#[native_db( + primary_key(id_string -> String) +)] +pub struct HistoryRecord { + pub id: Uuid, + pub original_uri: String, + pub uri: String, + pub title: Option, + pub timestamp: chrono::DateTime, +} + +impl HistoryRecord { + fn id_string(&self) -> String { + self.id.to_string() + } + + fn index_term(&self) -> Term { + Term::from_field_text(HISTORY_RECORD_SCHEMA.1["id"], &self.id.to_string()) + } +} + +impl From for TantivyDocument { + fn from(value: HistoryRecord) -> Self { + let mut doc = TantivyDocument::default(); + doc.add_text(HISTORY_RECORD_SCHEMA.1["id"], value.id); + doc.add_text(HISTORY_RECORD_SCHEMA.1["original_uri"], value.original_uri); + doc.add_text(HISTORY_RECORD_SCHEMA.1["uri"], value.uri); + if let Some(title) = value.title { + doc.add_text(HISTORY_RECORD_SCHEMA.1["title"], title); + } + doc.add_date( + HISTORY_RECORD_SCHEMA.1["timestamp"], + tantivy::DateTime::from_timestamp_micros(value.timestamp.timestamp_micros()), + ); + doc + } +} + +impl TryFrom for HistoryRecord { + type Error = miette::Report; + + fn try_from(value: TantivyDocument) -> Result { + let id = Uuid::parse_str( + value + .get_first(HISTORY_RECORD_SCHEMA.1["id"]) + .map(|x| x.as_str()) + .flatten() + .ok_or(miette::miette!("No ID for document in index … "))?, + ) + .into_diagnostic()?; + DATABASE + .get_history_record(id.clone()) + .ok() + .flatten() + .ok_or(miette::miette!( + "No history record with original URI {} found … ", + id + )) + } +} + +impl BrowserDatabase { + pub fn search_history_records( + query_string: String, + result_limit: Option, + ) -> miette::Result> { + let searcher = HISTORY_RECORD_INDEX_READER.searcher(); + let query_parser = QueryParser::for_index( + &*HISTORY_RECORD_INDEX, + vec![ + HISTORY_RECORD_SCHEMA.1["original_uri"], + HISTORY_RECORD_SCHEMA.1["uri"], + HISTORY_RECORD_SCHEMA.1["title"], + ], + ); + let query = query_parser.parse_query(&query_string).into_diagnostic()?; + let limit = result_limit.unwrap_or(10); + let top_docs = searcher + .search(&query, &TopDocs::with_limit(limit)) + .into_diagnostic()?; + Ok(top_docs + .par_iter() + .filter_map(|x| searcher.doc(x.1).ok()) + .collect::>() + .into_par_iter() + .filter_map(|x| TryInto::try_into(x).ok()) + .collect()) + } + + pub fn upsert_history_record( + &self, + history_record: HistoryRecord, + ) -> miette::Result> { + let rw: transaction::RwTransaction<'_> = + self.database.rw_transaction().into_diagnostic()?; + let old_value: Option = + rw.upsert(history_record.clone()).into_diagnostic()?; + rw.commit().into_diagnostic()?; + self.history_sender.send_replace(()); + + let mut index_writer = HISTORY_RECORD_INDEX_WRITER + .clone() + .try_lock_owned() + .into_diagnostic()?; + if let Some(old_history_record) = old_value.clone() { + index_writer.delete_term(old_history_record.index_term()); + } + index_writer + .add_document(history_record.into()) + .into_diagnostic()?; + index_writer.commit().into_diagnostic()?; + + Ok(old_value) + } + + pub fn upsert_history_records( + &self, + history_records: Vec, + ) -> miette::Result>> { + let rw = self.database.rw_transaction().into_diagnostic()?; + let old_history_records: Vec<_> = history_records + .into_iter() + .filter_map(|history_record| rw.upsert(history_record).ok()) + .collect(); + rw.commit().into_diagnostic()?; + self.history_sender.send_replace(()); + + let mut index_writer = HISTORY_RECORD_INDEX_WRITER + .clone() + .try_lock_owned() + .into_diagnostic()?; + old_history_records + .par_iter() + .for_each(|old_history_record| { + if let Some(old_history_record) = old_history_record { + index_writer.delete_term(old_history_record.index_term()); + } + }); + index_writer.commit().into_diagnostic()?; + + Ok(old_history_records) + } + + pub fn delete_history_record( + &self, + history_record: HistoryRecord, + ) -> miette::Result { + let rw = self.database.rw_transaction().into_diagnostic()?; + let removed_history_record = rw.remove(history_record).into_diagnostic()?; + rw.commit().into_diagnostic()?; + self.history_sender.send_replace(()); + + let mut index_writer = HISTORY_RECORD_INDEX_WRITER + .clone() + .try_lock_owned() + .into_diagnostic()?; + index_writer.delete_term(removed_history_record.index_term()); + index_writer.commit().into_diagnostic()?; + + Ok(removed_history_record) + } + + pub fn delete_history_records( + &self, + history_records: Vec, + ) -> miette::Result> { + let rw = self.database.rw_transaction().into_diagnostic()?; + let removed_history_records: Vec<_> = history_records + .into_iter() + .filter_map(|history_record| rw.remove(history_record).ok()) + .collect(); + rw.commit().into_diagnostic()?; + self.history_sender.send_replace(()); + + let mut index_writer = HISTORY_RECORD_INDEX_WRITER + .clone() + .try_lock_owned() + .into_diagnostic()?; + removed_history_records + .par_iter() + .for_each(|removed_history_record| { + index_writer.delete_term(removed_history_record.index_term()); + }); + index_writer.commit().into_diagnostic()?; + + Ok(removed_history_records) + } + + pub fn get_history_records(&self) -> miette::Result> { + let r = self.database.r_transaction().into_diagnostic()?; + let mut history_records = r + .scan() + .primary() + .into_diagnostic()? + .all() + .into_diagnostic()? + .collect::, _>>() + .into_diagnostic()?; + history_records.sort_unstable_by_key(|x: &HistoryRecord| Reverse(x.timestamp)); + Ok(history_records) + } + + pub fn get_history_record(&self, id: Uuid) -> miette::Result> { + let r = self.database.r_transaction().into_diagnostic()?; + Ok(r.get().primary(id.to_string()).into_diagnostic()?) + } +} diff --git a/src/database/mod.rs b/src/database/mod.rs new file mode 100644 index 00000000..488a101c --- /dev/null +++ b/src/database/mod.rs @@ -0,0 +1,9 @@ +mod bookmark; +mod core; +mod history_record; +#[allow(unused_imports)] +pub use self::bookmark::*; +#[allow(unused_imports)] +pub use self::core::*; +#[allow(unused_imports)] +pub use self::history_record::*; diff --git a/src/history.rs b/src/history.rs deleted file mode 100644 index 437ac854..00000000 --- a/src/history.rs +++ /dev/null @@ -1,310 +0,0 @@ -use crate::suggestion_item::SuggestionItem; -use crate::HISTORY_DIR; -use daggy::petgraph::graph::NodeIndex; -use daggy::petgraph::stable_graph::DefaultIx; -use daggy::petgraph::visit::IntoNodeReferences; -use daggy::stable_dag::StableDag; -use glob::glob; -use indicium::simple::Indexable; -use indicium::simple::SearchIndex; -use indicium::simple::SearchIndexBuilder; -use log::error; -use miette::IntoDiagnostic; -use serde::Deserialize; -use serde::Serialize; -use std::cell::RefCell; -use std::cmp::Reverse; -use std::path::PathBuf; -use uuid::Uuid; -use webkit2gtk::FaviconDatabase; - -#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, PartialOrd, Eq, Ord)] -pub struct HistoryItem { - pub(crate) uri: RefCell, - pub(crate) original_uri: RefCell, - pub(crate) title: RefCell, - pub(crate) timestamp: chrono::DateTime, -} - -impl HistoryItem { - pub fn new(uri: String, original_uri: String, title: String) -> Self { - Self { - uri: RefCell::new(uri), - original_uri: RefCell::new(original_uri), - title: RefCell::new(title), - timestamp: chrono::Utc::now(), - } - } - - pub fn uri(&self) -> String { - self.uri.borrow().to_owned() - } - - pub fn original_uri(&self) -> String { - self.original_uri.borrow().to_owned() - } - - pub fn title(&self) -> String { - self.title.borrow().to_owned() - } - - pub fn set_uri(&self, uri: String) -> String { - self.uri.replace(uri) - } - - pub fn set_original_uri(&self, original_uri: String) -> String { - self.original_uri.replace(original_uri) - } - - pub fn set_title(&self, title: String) -> String { - self.title.replace(title) - } - - pub fn to_suggestion_item(&self, favicon_database: &FaviconDatabase) -> SuggestionItem { - SuggestionItem::new(self.title(), self.uri(), &favicon_database) - } -} - -impl Indexable for HistoryItem { - fn strings(&self) -> Vec { - vec![self.uri(), self.original_uri(), self.title()] - } -} - -#[derive(Debug, Clone, Serialize, Deserialize)] -pub struct HistorySession { - pub(crate) graph: RefCell>, - pub(crate) id: Uuid, -} - -impl HistorySession { - pub fn new() -> miette::Result { - let _ = std::fs::create_dir_all(HISTORY_DIR.to_path_buf()); - let graph = RefCell::new(StableDag::new()); - let id = Uuid::new_v4(); - let session_file_path = HISTORY_DIR - .to_path_buf() - .join(format!("{}.oku-session", id)); - let history_session = Self { graph, id }; - let session_bytes = bincode::serialize(&history_session).into_diagnostic()?; - std::fs::write(session_file_path, session_bytes).into_diagnostic()?; - Ok(history_session) - } - - pub fn save(&self) { - let session_file_path = HISTORY_DIR - .to_path_buf() - .join(format!("{}.oku-session", self.id)); - match bincode::serialize(&self) { - Ok(session_bytes) => match std::fs::write(session_file_path, session_bytes) { - Ok(_) => (), - Err(e) => error!("{}", e), - }, - Err(e) => error!("{}", e), - } - } - - pub fn find_or_add_uri(&self, uri: String) -> NodeIndex { - if let Some(node_index) = self.find_uri(uri.clone()) { - node_index - } else { - self.graph - .borrow_mut() - .add_node(HistoryItem::new(uri.clone(), uri, String::new())) - } - } - - pub fn find_uri(&self, original_uri: String) -> Option> { - if let Some(node_index) = self - .graph - .borrow() - .node_references() - .position(|x| x.1.original_uri() == original_uri) - { - if let Ok(node_index) = node_index.try_into() { - Some(NodeIndex::new(node_index)) - } else { - None - } - } else { - None - } - } - - pub fn add_navigation( - &self, - old_uri: String, - new_uri: String, - ) -> Option<(NodeIndex, NodeIndex)> { - if old_uri != new_uri { - let old_uri_index = self.find_or_add_uri(old_uri); - let new_uri_index = self.find_or_add_uri(new_uri); - let _ = self - .graph - .borrow_mut() - .update_edge(old_uri_index, new_uri_index, ()); - return Some((old_uri_index, new_uri_index)); - } else { - None - } - } - - pub fn update_uri( - &self, - original_uri: String, - updated_uri: Option, - updated_title: Option, - ) { - if let Some(node_index) = self.find_uri(original_uri) { - if let Some(node) = self.graph.borrow().node_weight(node_index) { - if let Some(updated_uri) = updated_uri { - node.set_uri(updated_uri); - } - if let Some(updated_title) = updated_title { - node.set_title(updated_title); - } - } - } - } -} - -#[derive(Debug, Clone, Serialize, Deserialize)] -pub struct HistoryManager { - pub(crate) history_sessions: Vec, - pub(crate) current_session: RefCell, - #[serde(skip)] - pub(crate) search_index: RefCell)>>, -} - -impl HistoryManager { - pub fn add_navigation(&self, old_uri: String, new_uri: String) { - let current_session = self.get_current_session(); - match current_session.add_navigation(old_uri, new_uri) { - Some((old_uri_index, new_uri_index)) => { - let graph = current_session.graph.borrow(); - let old_history_item = graph.node_weight(old_uri_index); - let new_history_item = graph.node_weight(new_uri_index); - if let (Some(old_history_item), Some(new_history_item)) = - (old_history_item, new_history_item) - { - let mut search_index = self.search_index.borrow_mut(); - search_index.insert(&(current_session.id, old_uri_index), old_history_item); - search_index.insert(&(current_session.id, new_uri_index), new_history_item); - } - } - None => (), - } - } - - pub fn new_search_index() -> RefCell)>> { - RefCell::new( - SearchIndexBuilder::default() - .max_search_results(5) - .search_type(indicium::simple::SearchType::Live) - .build(), - ) - } - - pub fn load_sessions_or_create() -> miette::Result { - let search_index = Self::new_search_index(); - let current_session = RefCell::new(HistorySession::new().unwrap()); - current_session.borrow().save(); - let mut history_sessions: Vec = vec![]; - let files: Vec = glob(&format!( - "{}/*.oku-session", - HISTORY_DIR.to_path_buf().to_string_lossy() - )) - .unwrap() - .filter_map(Result::ok) - .collect(); - if files.len() == 0 { - Ok(Self { - history_sessions, - current_session, - search_index, - }) - } else { - for file in files { - match std::fs::read(file.clone()) { - Ok(file_bytes) => match bincode::deserialize::(&file_bytes) { - Ok(history_session) => { - if history_session.graph.borrow().node_count() == 0 - && history_session.id != current_session.borrow().id - { - let _ = std::fs::remove_file(file); - } else { - history_sessions.push(history_session); - } - } - Err(e) => { - error!("{}", e) - } - }, - Err(e) => { - error!("{}", e); - } - } - } - if history_sessions.len() == 0 { - Ok(Self { - history_sessions, - current_session, - search_index, - }) - } else { - let mut search_index_mut = search_index.borrow_mut(); - for history_session in history_sessions.iter() { - for (node_index, history_item) in - history_session.graph.borrow().node_references() - { - search_index_mut.insert(&(history_session.id, node_index), history_item); - } - } - drop(search_index_mut); - Ok(Self { - history_sessions, - current_session, - search_index, - }) - } - } - } - - pub fn get_current_session(&self) -> std::cell::Ref<'_, HistorySession> { - self.current_session.borrow() - } - - pub fn get_suggestions( - &self, - favicon_database: &FaviconDatabase, - search: String, - ) -> Vec { - if search.trim().is_empty() { - return vec![]; - } - let mut history_items = self - .search_index - .borrow() - .search(&search) - .iter() - .map(|x| { - let history_session = if x.0 == self.current_session.borrow().id { - &*self.current_session.borrow() - } else { - self.history_sessions.iter().find(|y| y.id == x.0).unwrap() - }; - let graph = history_session.graph.borrow(); - graph.node_weight(x.1).unwrap().clone() - }) - .collect::>(); - history_items.sort_unstable_by_key(|x| (x.uri(), Reverse(x.timestamp))); - history_items.dedup_by_key(|x| x.uri()); - history_items.sort_unstable_by_key(|x| (x.original_uri(), Reverse(x.timestamp))); - history_items.dedup_by_key(|x| x.original_uri()); - history_items.truncate(5); - history_items - .iter() - .map(|x| x.to_suggestion_item(favicon_database)) - .collect::>() - } -} diff --git a/src/history_item.rs b/src/history_item.rs new file mode 100644 index 00000000..8e6db97a --- /dev/null +++ b/src/history_item.rs @@ -0,0 +1,144 @@ +use glib::clone; +use glib::property::PropertySet; +use glib::subclass::object::ObjectImpl; +use glib::subclass::types::ObjectSubclass; +use glib::subclass::types::ObjectSubclassExt; +use glib::subclass::types::ObjectSubclassIsExt; +use glib::value::ToValue; +use glib::ParamSpec; +use glib::ParamSpecBuilderExt; +use glib::ParamSpecObject; +use glib::ParamSpecString; +use glib::Value; +use once_cell::sync::Lazy; +use std::cell::RefCell; +use uuid::Uuid; +use webkit2gtk::functions::uri_for_display; + +pub mod imp { + use super::*; + + #[derive(Default, Debug)] + pub struct HistoryItem { + pub(crate) id: RefCell, + pub(crate) title: RefCell, + pub(crate) uri: RefCell, + pub(crate) timestamp: RefCell, + pub(crate) favicon: RefCell>, + } + + #[glib::object_subclass] + impl ObjectSubclass for HistoryItem { + const NAME: &'static str = "OkuHistoryItem"; + type Type = super::HistoryItem; + } + + impl ObjectImpl for HistoryItem { + fn properties() -> &'static [ParamSpec] { + static PROPERTIES: Lazy> = Lazy::new(|| { + vec![ + ParamSpecString::builder("id").readwrite().build(), + ParamSpecString::builder("title").readwrite().build(), + ParamSpecString::builder("uri").readwrite().build(), + ParamSpecString::builder("timestamp").readwrite().build(), + ParamSpecObject::builder::("favicon") + .readwrite() + .build(), + ] + }); + PROPERTIES.as_ref() + } + + fn set_property(&self, _id: usize, value: &Value, pspec: &ParamSpec) { + match pspec.name() { + "id" => { + let id = value.get::().unwrap(); + self.id.set(Uuid::parse_str(&id).unwrap()); + } + "uri" => { + let uri = value.get::().unwrap(); + self.uri.set( + html_escape::encode_text(&uri_for_display(&uri).unwrap_or(uri.into())) + .to_string(), + ); + } + "title" => { + let title = value.get::().unwrap(); + self.title.set(html_escape::encode_text(&title).to_string()); + } + "timestamp" => { + let timestamp = value.get::().unwrap(); + self.timestamp + .set(html_escape::encode_text(×tamp).to_string()); + } + "favicon" => { + let favicon = value.get::().ok(); + self.favicon.set(favicon); + } + _ => unimplemented!(), + } + } + + fn property(&self, _id: usize, pspec: &ParamSpec) -> Value { + let obj = self.obj(); + match pspec.name() { + "id" => obj.id().to_string().to_value(), + "title" => obj.title().to_value(), + "uri" => obj.uri().to_value(), + "timestamp" => obj.timestamp().to_value(), + "favicon" => obj.favicon().to_value(), + _ => unimplemented!(), + } + } + } +} + +glib::wrapper! { + pub struct HistoryItem(ObjectSubclass); +} + +impl HistoryItem { + pub fn id(&self) -> Uuid { + self.imp().id.borrow().to_owned() + } + pub fn title(&self) -> String { + self.imp().title.borrow().to_string() + } + pub fn timestamp(&self) -> String { + self.imp().timestamp.borrow().to_string() + } + pub fn uri(&self) -> String { + self.imp().uri.borrow().to_string() + } + pub fn favicon(&self) -> Option { + self.imp().favicon.borrow().clone() + } + pub fn new( + id: Uuid, + title: String, + uri: String, + timestamp: String, + favicon_database: &webkit2gtk::FaviconDatabase, + ) -> Self { + let history_item = glib::Object::builder::() + .property("id", id.to_string()) + .property("title", title) + .property("timestamp", timestamp) + .property("uri", uri.clone()) + .build(); + + favicon_database.favicon( + &uri, + Some(&gio::Cancellable::new()), + clone!( + #[weak] + history_item, + move |favicon_result| { + history_item.imp().favicon.set(favicon_result.ok()); + } + ), + ); + + history_item + } +} diff --git a/src/main.rs b/src/main.rs index 36fcafd1..b65a4a9a 100755 --- a/src/main.rs +++ b/src/main.rs @@ -22,7 +22,8 @@ html_favicon_url = "https://github.com/OkuBrowser/oku/raw/master/branding/logo-filled.svg" )] pub mod config; -pub mod history; +pub mod database; +pub mod history_item; pub mod replica_item; pub mod scheme_handlers; pub mod suggestion_item; @@ -30,13 +31,13 @@ pub mod widgets; pub mod window_util; use config::Config; +use database::DATABASE; use directories_next::ProjectDirs; use directories_next::UserDirs; use env_logger::Builder; use gio::prelude::*; use glib_macros::clone; use gtk::prelude::GtkApplicationExt; -use history::HistoryManager; use ipfs::Ipfs; use ipfs::Keypair; use ipfs::UninitializedIpfsDefault as UninitializedIpfs; @@ -75,9 +76,7 @@ lazy_static! { static ref MOUNT_DIR: PathBuf = DATA_DIR.join("mount"); /// The platform-specific file path where Oku settings are stored static ref CONFIG_DIR: PathBuf = DATA_DIR.join("config.toml"); - static ref HISTORY_DIR: PathBuf = DATA_DIR.join("history"); static ref CONFIG: Arc> = Arc::new(Mutex::new(Config::load_or_default())); - static ref HISTORY_MANAGER: Arc> = Arc::new(Mutex::new(HistoryManager::load_sessions_or_create().unwrap())); /// The current release version number of Oku static ref VERSION: &'static str = option_env!("CARGO_PKG_VERSION").unwrap(); } @@ -319,10 +318,33 @@ async fn main() { } )); application.connect_window_added(clone!(move |_, window| { + let window: widgets::window::Window = window.clone().downcast().unwrap(); + let ctx = glib::MainContext::default(); + let mut history_rx = DATABASE.history_sender.subscribe(); + ctx.spawn_local_with_priority( + glib::source::Priority::HIGH, + clone!( + #[weak] + window, + async move { + loop { + history_rx.borrow_and_update(); + info!("History updated … "); + window.history_updated(); + match history_rx.changed().await { + Ok(_) => continue, + Err(e) => { + error!("{}", e); + break; + } + } + } + } + ), + ); + if let Some(node) = NODE.get() { - let mut rx = node.replica_sender.subscribe(); - let window: widgets::window::Window = window.clone().downcast().unwrap(); - let ctx = glib::MainContext::default(); + let mut replica_rx = node.replica_sender.subscribe(); ctx.spawn_local_with_priority( glib::source::Priority::HIGH, clone!( @@ -330,10 +352,10 @@ async fn main() { window, async move { loop { - rx.borrow_and_update(); + replica_rx.borrow_and_update(); info!("Replicas updated … "); window.replicas_updated(); - match rx.changed().await { + match replica_rx.changed().await { Ok(_) => continue, Err(e) => { error!("{}", e); diff --git a/src/widgets/history_row.rs b/src/widgets/history_row.rs new file mode 100644 index 00000000..bf2d95be --- /dev/null +++ b/src/widgets/history_row.rs @@ -0,0 +1,287 @@ +use gdk::prelude::DisplayExt; +use gio::prelude::ApplicationExt; +use glib::clone; +use glib::object::Cast; +use glib::object::CastNone; +use glib::subclass::object::ObjectImpl; +use glib::subclass::types::ObjectSubclass; +use glib::subclass::types::ObjectSubclassExt; +use glib::subclass::types::ObjectSubclassIsExt; +use glib::value::ToValue; +use glib::ParamSpec; +use glib::ParamSpecObject; +use glib::ParamSpecString; +use glib::Value; +use gtk::prelude::BoxExt; +use gtk::prelude::ButtonExt; +use gtk::prelude::GtkWindowExt; +use gtk::prelude::ListBoxRowExt; +use gtk::prelude::WidgetExt; +use gtk::subclass::prelude::*; +use libadwaita::prelude::ActionRowExt; +use libadwaita::prelude::PreferencesRowExt; +use libadwaita::subclass::prelude::*; +use log::error; +use once_cell::sync::Lazy; +use std::cell::RefCell; +use uuid::Uuid; +use webkit2gtk::functions::uri_for_display; + +use crate::database::DATABASE; +use crate::window_util::get_window_from_widget; + +pub mod imp { + + use uuid::Uuid; + + use super::*; + + #[derive(Debug, Default)] + pub struct HistoryRow { + pub(crate) id: RefCell, + pub(crate) title: RefCell, + pub(crate) uri: RefCell, + pub(crate) timestamp: RefCell, + pub(crate) favicon: gtk::Image, + pub(crate) copy_url_button: gtk::Button, + pub(crate) delete_button: gtk::Button, + pub(crate) button_box: gtk::Box, + } + + impl HistoryRow {} + + #[glib::object_subclass] + impl ObjectSubclass for HistoryRow { + const NAME: &'static str = "OkuHistoryRow"; + type Type = super::HistoryRow; + type ParentType = libadwaita::ActionRow; + + fn class_init(klass: &mut Self::Class) { + klass.set_layout_manager_type::(); + klass.set_accessible_role(gtk::AccessibleRole::Generic); + } + } + + impl ObjectImpl for HistoryRow { + fn dispose(&self) { + while let Some(child) = self.obj().first_child() { + child.unparent(); + } + } + + fn constructed(&self) { + self.parent_constructed(); + + self.obj().setup(); + } + + fn properties() -> &'static [ParamSpec] { + static PROPERTIES: Lazy> = Lazy::new(|| { + vec![ + ParamSpecString::builder("id").build(), + ParamSpecString::builder("title-property").build(), + ParamSpecString::builder("uri").build(), + ParamSpecString::builder("timestamp").build(), + ParamSpecObject::builder::("favicon").build(), + ] + }); + PROPERTIES.as_ref() + } + + fn set_property(&self, _id: usize, value: &Value, pspec: &ParamSpec) { + match pspec.name() { + "id" => { + let id = value.get::().unwrap(); + self.obj().set_id(Uuid::parse_str(&id).unwrap()); + } + "title-property" => { + let title = value.get::<&str>().unwrap(); + self.obj().set_title_property(title); + } + "timestamp" => { + let timestamp = value.get::<&str>().unwrap(); + self.obj().set_timestamp(timestamp); + } + "uri" => { + let uri = value.get::<&str>().unwrap(); + self.obj().set_uri(uri); + } + "favicon" => { + let favicon = value.get::().ok(); + self.obj().set_favicon(favicon); + } + _ => unimplemented!(), + } + } + + fn property(&self, _id: usize, pspec: &ParamSpec) -> Value { + match pspec.name() { + "id" => self.obj().id().to_string().to_value(), + "title-property" => self.obj().title_property().to_value(), + "timestamp" => self.obj().timestamp().to_value(), + "uri" => self.obj().uri().to_value(), + "favicon" => self.obj().favicon().to_value(), + _ => unimplemented!(), + } + } + } + impl WidgetImpl for HistoryRow {} + impl ListBoxRowImpl for HistoryRow {} + impl PreferencesRowImpl for HistoryRow {} + impl ActionRowImpl for HistoryRow {} +} + +glib::wrapper! { + pub struct HistoryRow(ObjectSubclass) + @extends libadwaita::ActionRow, libadwaita::PreferencesRow, gtk::ListBoxRow, gtk::Widget, + @implements gtk::Accessible, gtk::Actionable, gtk::Buildable, gtk::ConstraintTarget; +} + +impl Default for HistoryRow { + fn default() -> Self { + glib::Object::new() + } +} + +impl HistoryRow { + pub fn new() -> Self { + Self::default() + } + + pub fn setup(&self) { + let imp = self.imp(); + + imp.copy_url_button.set_icon_name("copy-symbolic"); + imp.copy_url_button.add_css_class("circular"); + imp.copy_url_button.add_css_class("linked"); + imp.copy_url_button.set_vexpand(false); + imp.copy_url_button.set_hexpand(false); + imp.copy_url_button.set_tooltip_text(Some("Copy URL")); + imp.copy_url_button.connect_clicked(clone!( + #[weak(rename_to = this)] + self, + move |_| { + let clipboard = gdk::Display::default().unwrap().clipboard(); + clipboard.set_text(&this.uri()); + let window = get_window_from_widget(&this); + let app = window.application().unwrap(); + let notification = gio::Notification::new("History URL copied"); + notification.set_body(Some(&format!( + "A URL from the browser history ({}) has been copied to the clipboard.", + this.uri() + ))); + app.send_notification(None, ¬ification); + } + )); + + imp.delete_button.set_icon_name("user-trash-symbolic"); + imp.delete_button.add_css_class("circular"); + imp.delete_button.add_css_class("destructive-action"); + imp.delete_button.set_vexpand(false); + imp.delete_button.set_hexpand(false); + imp.delete_button.connect_clicked(clone!( + #[weak(rename_to = this)] + self, + move |_| { + if let Some(history_record) = DATABASE.get_history_record(this.id()).ok().flatten() + { + if let Err(e) = DATABASE.delete_history_record(history_record) { + error!("{}", e) + } + } + } + )); + + imp.button_box.append(&imp.copy_url_button); + imp.button_box.append(&imp.delete_button); + imp.button_box.set_homogeneous(false); + imp.button_box.set_valign(gtk::Align::Center); + imp.button_box.set_halign(gtk::Align::End); + imp.button_box.add_css_class("linked"); + + let content_box: gtk::Box = self.child().and_downcast().unwrap(); + content_box.set_hexpand(true); + + self.add_prefix(&imp.favicon); + self.add_suffix(&imp.button_box); + self.set_title_lines(1); + self.set_subtitle_lines(2); + self.add_css_class("caption"); + self.add_css_class("card"); + } + + pub fn id(&self) -> Uuid { + self.imp().id.borrow().to_owned() + } + pub fn title_property(&self) -> String { + self.imp().title.borrow().to_string() + } + pub fn timestamp(&self) -> String { + self.imp().timestamp.borrow().to_string() + } + pub fn uri(&self) -> String { + self.imp().uri.borrow().to_string() + } + pub fn favicon(&self) -> Option { + self.imp() + .favicon + .paintable()? + .downcast::() + .ok() + } + + pub fn set_id(&self, id: Uuid) { + let imp = self.imp(); + + imp.id.replace(id); + } + + fn update_title(&self) { + let encoded_title = &self.title_property(); + let encoded_uri = uri_for_display(&self.uri()) + .unwrap_or(self.uri().into()) + .to_string(); + let encoded_timestamp = &self.timestamp(); + if encoded_title.trim().is_empty() { + self.set_title(&encoded_uri); + self.set_subtitle(&encoded_timestamp); + } else { + self.set_title(&encoded_title); + self.set_subtitle(&format!("{}\n{}", encoded_uri, encoded_timestamp)); + } + } + + pub fn set_title_property(&self, title: &str) { + let imp = self.imp(); + + imp.title.replace(title.to_string()); + self.update_title(); + } + + pub fn set_uri(&self, uri: &str) { + let imp = self.imp(); + + imp.uri.replace(uri.to_string()); + self.update_title(); + } + + pub fn set_timestamp(&self, timestamp: &str) { + let imp = self.imp(); + + imp.timestamp.replace(timestamp.to_string()); + self.update_title(); + } + + pub fn set_favicon(&self, favicon: Option) { + let imp = self.imp(); + + match favicon { + Some(favicon) => { + imp.favicon.set_paintable(Some(&favicon)); + } + None => { + imp.favicon.set_icon_name(Some("globe-symbolic")); + } + } + } +} diff --git a/src/widgets/mod.rs b/src/widgets/mod.rs index 54a61df5..4cb28a6f 100644 --- a/src/widgets/mod.rs +++ b/src/widgets/mod.rs @@ -1,3 +1,4 @@ +pub mod history_row; pub mod replica_row; pub mod settings; pub mod suggestion_row; diff --git a/src/widgets/replica_row.rs b/src/widgets/replica_row.rs index 41633472..ce625821 100644 --- a/src/widgets/replica_row.rs +++ b/src/widgets/replica_row.rs @@ -4,6 +4,7 @@ use crate::NODE; use gdk::prelude::DisplayExt; use gio::prelude::ApplicationExt; use glib::clone; +use glib::object::CastNone; use glib::subclass::object::ObjectImpl; use glib::subclass::types::ObjectSubclass; use glib::subclass::types::ObjectSubclassExt; @@ -16,6 +17,7 @@ use glib::Value; use gtk::prelude::BoxExt; use gtk::prelude::ButtonExt; use gtk::prelude::GtkWindowExt; +use gtk::prelude::ListBoxRowExt; use gtk::prelude::WidgetExt; use gtk::subclass::prelude::*; use libadwaita::prelude::ActionRowExt; @@ -145,7 +147,7 @@ impl ReplicaRow { } )); - imp.read_ticket_button.set_icon_name("share-symbolic"); + imp.read_ticket_button.set_icon_name("ticket-symbolic"); imp.read_ticket_button.add_css_class("linked"); imp.read_ticket_button.set_vexpand(false); imp.read_ticket_button.set_hexpand(false); @@ -185,7 +187,8 @@ impl ReplicaRow { } )); - imp.write_ticket_button.set_icon_name("people-symbolic"); + imp.write_ticket_button + .set_icon_name("ticket-special-symbolic"); imp.write_ticket_button.add_css_class("linked"); imp.write_ticket_button.add_css_class("destructive-action"); imp.write_ticket_button.set_vexpand(false); @@ -344,10 +347,14 @@ impl ReplicaRow { imp.button_box.set_halign(gtk::Align::End); imp.button_box.add_css_class("linked"); + let content_box: gtk::Box = self.child().and_downcast().unwrap(); + content_box.set_hexpand(true); + self.add_prefix(&imp.icon); self.add_suffix(&imp.button_box); self.set_title_lines(1); self.add_css_class("caption"); + self.add_css_class("card"); } pub fn id(&self) -> String { diff --git a/src/widgets/suggestion_row.rs b/src/widgets/suggestion_row.rs index 7013b35b..12304243 100644 --- a/src/widgets/suggestion_row.rs +++ b/src/widgets/suggestion_row.rs @@ -128,14 +128,12 @@ impl SuggestionRow { pub fn uri(&self) -> String { self.imp().uri.borrow().to_string() } - pub fn favicon(&self) -> gdk::Texture { + pub fn favicon(&self) -> Option { self.imp() .favicon - .paintable() - .unwrap() - .downcast_ref::() - .unwrap() - .clone() + .paintable()? + .downcast::() + .ok() } pub fn set_title_property(&self, title: &str) { diff --git a/src/widgets/window.rs b/src/widgets/window.rs index d0f2df5c..0ed4909f 100644 --- a/src/widgets/window.rs +++ b/src/widgets/window.rs @@ -1,12 +1,14 @@ use super::settings::apply_appearance_config; use crate::config::Palette; +use crate::database::{HistoryRecord, DATABASE}; +use crate::history_item::HistoryItem; use crate::replica_item::ReplicaItem; use crate::suggestion_item::SuggestionItem; use crate::window_util::{ - connect, get_title, get_view_from_page, get_window_from_widget, new_webkit_settings, - update_favicon, update_nav_bar, update_title, + connect, get_title, get_view_from_page, get_view_stack_page_by_name, get_window_from_widget, + new_webkit_settings, update_favicon, update_nav_bar, update_title, }; -use crate::{CONFIG, DATA_DIR, HISTORY_MANAGER, MOUNT_DIR, NODE, VERSION}; +use crate::{CONFIG, DATA_DIR, MOUNT_DIR, NODE, VERSION}; use chrono::Utc; use glib::clone; use gtk::prelude::GtkWindowExt; @@ -21,15 +23,15 @@ use std::cell::RefCell; use std::cell::{Cell, Ref}; use std::hash::{Hash, Hasher}; use std::rc::Rc; +use uuid::Uuid; use webkit2gtk::functions::{ uri_for_display, user_media_permission_is_for_audio_device, user_media_permission_is_for_display_device, user_media_permission_is_for_video_device, }; use webkit2gtk::prelude::PermissionRequestExt; -use webkit2gtk::prelude::PolicyDecisionExt; use webkit2gtk::prelude::WebViewExt; -use webkit2gtk::{FindOptions, NavigationPolicyDecision, PolicyDecisionType, WebContext, WebView}; -use webkit2gtk::{LoadEvent, NavigationType}; +use webkit2gtk::LoadEvent; +use webkit2gtk::{FindOptions, WebContext, WebView}; pub mod imp { use super::*; @@ -76,7 +78,6 @@ pub mod imp { pub(crate) screenshot_button: gtk::Button, pub(crate) new_window_button: gtk::Button, pub(crate) new_private_window_button: gtk::Button, - pub(crate) history_button: gtk::Button, pub(crate) settings_button: gtk::Button, pub(crate) about_button: gtk::Button, pub(crate) shortcuts_button: gtk::Button, @@ -111,12 +112,21 @@ pub mod imp { pub(crate) split_view: libadwaita::OverlaySplitView, // Sidebar content pub(crate) side_box: gtk::Box, - pub(crate) add_replicas_button: gtk::Button, + pub(crate) side_view_stack: libadwaita::ViewStack, + pub(crate) side_view_switcher: libadwaita::ViewSwitcher, + pub(crate) replicas_box: gtk::Box, + pub(crate) history_box: gtk::Box, + pub(crate) history_store: RefCell>>, + pub(crate) history_factory: gtk::SignalListItemFactory, + pub(crate) history_model: gtk::SingleSelection, + pub(crate) history_view: gtk::ListView, + pub(crate) history_scrolled_window: gtk::ScrolledWindow, + pub(crate) add_replicas_button: libadwaita::ButtonRow, pub(crate) replicas_store: RefCell>>, pub(crate) replicas_factory: gtk::SignalListItemFactory, pub(crate) replicas_model: gtk::SingleSelection, pub(crate) replicas_view: gtk::ListView, - pub(crate) replicas_scrolled_window: libadwaita::ClampScrollable, + pub(crate) replicas_scrolled_window: gtk::ScrolledWindow, // Miscellaneous pub(crate) progress_animation: RefCell>, pub(crate) progress_bar: gtk::ProgressBar, @@ -175,7 +185,7 @@ impl Window { this.setup_downloads_popover(); this.setup_find_popover(); this.setup_tabs(); - this.setup_main_content(); + this.setup_main_content(&web_context); this.setup_overview_button_clicked(); this.setup_downloads_button_clicked(); this.setup_find_button_clicked(); @@ -635,11 +645,6 @@ impl Window { imp.new_private_window_button .set_icon_name("screen-privacy7-symbolic"); - // History button - imp.history_button.set_can_focus(true); - imp.history_button.set_receives_default(true); - imp.history_button.set_icon_name("document-open-recent"); - // Settings button imp.settings_button.set_can_focus(true); imp.settings_button.set_receives_default(true); @@ -666,7 +671,6 @@ impl Window { imp.menu_box.append(&imp.screenshot_button); imp.menu_box.append(&imp.new_window_button); imp.menu_box.append(&imp.new_private_window_button); - imp.menu_box.append(&imp.history_button); imp.menu_box.append(&imp.shortcuts_button); imp.menu_box.append(&imp.settings_button); imp.menu_box.append(&imp.about_button); @@ -979,7 +983,7 @@ impl Window { imp.progress_bar.set_valign(gtk::Align::Start); } - fn setup_main_content(&self) { + fn setup_main_content(&self, web_context: &WebContext) { let imp = self.imp(); self.setup_url_status(); @@ -996,7 +1000,7 @@ impl Window { imp.main_box.append(&imp.tab_bar_revealer); imp.main_box.append(&imp.main_overlay); - self.setup_replicas_sidebar(); + self.setup_sidebar(&web_context); imp.split_view.set_content(Some(&imp.main_box)); imp.split_view.set_sidebar(Some(&imp.side_box)); imp.split_view.set_max_sidebar_width(400.0); @@ -1094,7 +1098,6 @@ impl Window { }; let web_view = web_view_builder.build(); web_view.set_vexpand(true); - web_view.set_background_color(&gdk::RGBA::new(1.00, 1.00, 1.00, 0.00)); let network_session = web_view.network_session().unwrap(); let data_manager = network_session.website_data_manager().unwrap(); let security_manager = web_context.security_manager().unwrap(); @@ -1126,8 +1129,6 @@ impl Window { } else { web_view.load_uri("oku:home"); } - let rgba = gdk::RGBA::new(1.00, 1.00, 1.00, 0.00); - web_view.set_background_color(&rgba); web_view.set_visible(true); web_view @@ -1416,12 +1417,9 @@ impl Window { .favicon_database() .unwrap(); - let mut suggestion_items = Vec::new(); - if let Ok(history_manager) = HISTORY_MANAGER.try_lock() { - suggestion_items = history_manager - .get_suggestions(&favicon_database, imp.nav_entry.text().to_string()); - drop(history_manager); - } + let suggestion_items = DATABASE + .search(imp.nav_entry.text().to_string(), &favicon_database) + .unwrap_or_default(); let suggestions_store = this.suggestions_store(); suggestions_store.remove_all(); if imp.suggestions_popover.is_visible() { @@ -1447,6 +1445,52 @@ impl Window { }) } + pub fn history_store(&self) -> Ref { + let history_store = self.imp().history_store.borrow(); + + Ref::map(history_store, |history_store| { + let history_store = history_store.as_deref().unwrap(); + history_store + }) + } + + pub fn history_updated(&self) { + let favicon_database = self + .get_view() + .network_session() + .unwrap() + .website_data_manager() + .unwrap() + .favicon_database() + .unwrap(); + let history_store = self.history_store(); + let history_records = DATABASE.get_history_records().unwrap_or_default(); + let items: Vec<_> = history_records + .into_iter() + .map(|x| { + HistoryItem::new( + x.id, + x.title.unwrap_or(String::new()), + x.uri, + x.timestamp.to_rfc2822(), + &favicon_database, + ) + }) + .collect(); + history_store.remove_all(); + if items.len() > 0 { + for item in items.iter() { + history_store.append(item); + } + } + + if let Some(history_page) = + get_view_stack_page_by_name("history".to_string(), &self.imp().side_view_stack) + { + history_page.set_needs_attention(true) + } + } + pub fn replicas_store(&self) -> Ref { let replicas_store = self.imp().replicas_store.borrow(); @@ -1496,16 +1540,137 @@ impl Window { } ), ); + if let Some(replicas_page) = + get_view_stack_page_by_name("replicas".to_string(), &self.imp().side_view_stack) + { + replicas_page.set_needs_attention(true) + } } - pub fn setup_replicas_sidebar(&self) { + pub fn setup_sidebar(&self, web_context: &WebContext) { let imp = self.imp(); - imp.add_replicas_button.set_icon_name("folder-new"); - imp.add_replicas_button.set_vexpand(false); - imp.add_replicas_button.set_hexpand(false); - imp.add_replicas_button.add_css_class("flat"); - imp.add_replicas_button.connect_clicked(clone!(move |_| { + imp.side_view_switcher.set_stack(Some(&imp.side_view_stack)); + + self.setup_replicas_page(); + self.setup_history_page(&web_context); + imp.side_view_stack + .connect_visible_child_notify(clone!(move |side_view_stack| { + if let Some(visible_page) = get_view_stack_page_by_name( + side_view_stack + .visible_child_name() + .unwrap_or_default() + .to_string(), + side_view_stack, + ) { + visible_page.set_needs_attention(false); + } + })); + + imp.side_box.set_orientation(gtk::Orientation::Vertical); + imp.side_box.set_spacing(8); + imp.side_box.set_margin_top(4); + imp.side_box.append(&imp.side_view_switcher); + imp.side_box.append(&imp.side_view_stack); + } + + pub fn setup_history_page(&self, web_context: &WebContext) { + let imp = self.imp(); + + let history_store = gio::ListStore::new::(); + imp.history_store.replace(Some(Rc::new(history_store))); + + imp.history_model + .set_model(Some(&self.history_store().clone())); + imp.history_model.set_autoselect(false); + imp.history_model.set_can_unselect(true); + imp.history_model.connect_selected_item_notify(clone!( + #[weak(rename_to = this)] + self, + #[weak] + imp, + #[weak] + web_context, + move |history_model| { + if let Some(item) = history_model.selected_item() { + let history_item = item.downcast_ref::().unwrap(); + let new_view = this.new_tab_page(&web_context, None, None).0; + new_view.load_uri(&history_item.uri()); + imp.history_model.unselect_all(); + } + } + )); + + imp.history_factory.connect_setup(clone!(move |_, item| { + let row = super::history_row::HistoryRow::new(); + let list_item = item.downcast_ref::().unwrap(); + list_item.set_child(Some(&row)); + list_item + .property_expression("item") + .chain_property::("id") + .bind(&row, "id", gtk::Widget::NONE); + list_item + .property_expression("item") + .chain_property::("title") + .bind(&row, "title-property", gtk::Widget::NONE); + list_item + .property_expression("item") + .chain_property::("uri") + .bind(&row, "uri", gtk::Widget::NONE); + list_item + .property_expression("item") + .chain_property::("favicon") + .bind(&row, "favicon", gtk::Widget::NONE); + list_item + .property_expression("item") + .chain_property::("timestamp") + .bind(&row, "timestamp", gtk::Widget::NONE); + })); + + imp.history_view.set_model(Some(&imp.history_model)); + imp.history_view.set_factory(Some(&imp.history_factory)); + imp.history_view.set_enable_rubberband(false); + imp.history_view + .set_hscroll_policy(gtk::ScrollablePolicy::Minimum); + imp.history_view + .set_vscroll_policy(gtk::ScrollablePolicy::Natural); + imp.history_view.set_vexpand(true); + imp.history_view.add_css_class("boxed-list-separate"); + imp.history_view.add_css_class("navigation-sidebar"); + + imp.history_scrolled_window + .set_child(Some(&imp.history_view)); + imp.history_scrolled_window + .set_hscrollbar_policy(gtk::PolicyType::Never); + imp.history_scrolled_window + .set_propagate_natural_height(true); + imp.history_scrolled_window + .set_propagate_natural_width(true); + + imp.history_box.set_orientation(gtk::Orientation::Vertical); + imp.history_box.append(&imp.history_scrolled_window); + + imp.history_box.set_orientation(gtk::Orientation::Vertical); + imp.history_box.set_spacing(4); + + imp.side_view_stack.add_titled_with_icon( + &imp.history_box, + Some("history"), + "History", + "hourglass-symbolic", + ); + } + + pub fn setup_replicas_page(&self) { + let imp = self.imp(); + + imp.add_replicas_button + .set_start_icon_name(Some("folder-new")); + imp.add_replicas_button.set_margin_start(4); + imp.add_replicas_button.set_margin_end(4); + imp.add_replicas_button.set_title("New replica"); + imp.add_replicas_button.add_css_class("card"); + imp.add_replicas_button.connect_activated(clone!(move |_| { let ctx = glib::MainContext::default(); ctx.spawn_local_with_priority( glib::source::Priority::HIGH, @@ -1528,9 +1693,12 @@ impl Window { imp.replicas_model .set_model(Some(&self.replicas_store().clone())); imp.replicas_model.set_autoselect(false); + imp.replicas_model.set_can_unselect(true); imp.replicas_model.connect_selected_item_notify(clone!( #[weak(rename_to = this)] self, + #[weak] + imp, move |replicas_model| { if let Some(item) = replicas_model.selected_item() { let replica_item = item.downcast_ref::().unwrap(); @@ -1543,6 +1711,7 @@ impl Window { replica_item.id() ))); app.send_notification(None, ¬ification); + imp.replicas_model.unselect_all(); } } )); @@ -1565,21 +1734,32 @@ impl Window { imp.replicas_view.set_factory(Some(&imp.replicas_factory)); imp.replicas_view.set_enable_rubberband(false); imp.replicas_view - .set_hscroll_policy(gtk::ScrollablePolicy::Natural); + .set_hscroll_policy(gtk::ScrollablePolicy::Minimum); imp.replicas_view .set_vscroll_policy(gtk::ScrollablePolicy::Natural); + imp.replicas_view.set_vexpand(true); imp.replicas_view.add_css_class("boxed-list-separate"); imp.replicas_view.add_css_class("navigation-sidebar"); imp.replicas_scrolled_window .set_child(Some(&imp.replicas_view)); imp.replicas_scrolled_window - .set_orientation(gtk::Orientation::Horizontal); + .set_hscrollbar_policy(gtk::PolicyType::Never); + imp.replicas_scrolled_window + .set_propagate_natural_height(true); + imp.replicas_scrolled_window + .set_propagate_natural_width(true); - imp.side_box.set_orientation(gtk::Orientation::Vertical); - imp.side_box.set_spacing(4); - imp.side_box.append(&imp.add_replicas_button); - imp.side_box.append(&imp.replicas_scrolled_window); + imp.replicas_box.set_orientation(gtk::Orientation::Vertical); + imp.replicas_box.append(&imp.add_replicas_button); + imp.replicas_box.append(&imp.replicas_scrolled_window); + + imp.side_view_stack.add_titled_with_icon( + &imp.replicas_box, + Some("replicas"), + "Replicas", + "people-symbolic", + ); } pub fn setup_suggestions_popover(&self) { @@ -2527,49 +2707,6 @@ impl Window { } )); - let decide_policy = RefCell::new(Some(new_view.connect_decide_policy(clone!( - move |w, policy_decision, decision_type| { - match decision_type { - PolicyDecisionType::NavigationAction => { - let navigation_policy_decision: NavigationPolicyDecision = policy_decision.clone().downcast().unwrap(); - navigation_policy_decision.use_(); - if let Some(mut navigation_action) = navigation_policy_decision.navigation_action() { - let navigation_type = navigation_action.navigation_type(); - if let Some(request) = navigation_action.request() { - if !get_window_from_widget(w).imp().is_private.get() { - if let Some(back_forward_list) = w.back_forward_list() { - if let Some(current_item) = back_forward_list.current_item() { - if let Some(old_uri) = current_item.original_uri() { - if let Some(new_uri) = request.uri() { - match navigation_type { - NavigationType::LinkClicked => { - if let Ok(history_manager) = HISTORY_MANAGER.try_lock() { - history_manager.add_navigation(old_uri.to_string(), new_uri.to_string()); - let current_session = history_manager.get_current_session(); - current_session.update_uri(old_uri.to_string(), current_item.uri().map(|x| x.to_string()), Some(get_title(&w))); - current_session.save(); - drop(current_session); - drop(history_manager); - } else { - warn!("Could not lock history manager while clicking link."); - } - }, - _ => () - } - } - } - } - } - } - } - } - true - }, - _ => false - } - } - )))); - let found_text = RefCell::new( Some( find_controller.connect_found_text( @@ -2613,30 +2750,6 @@ impl Window { #[upgrade_or_panic] move |w, navigation_action| { let mut navigation_action = navigation_action.clone(); let new_related_view = this.new_tab_page(&web_context, Some(w), navigation_action.request().as_ref()).0; - if !get_window_from_widget(&new_related_view).imp().is_private.get() { - if let Some(back_forward_list) = new_related_view.back_forward_list() { - if let Some(current_item) = back_forward_list.current_item() { - if let Some(old_uri) = current_item.original_uri() { - if let Some(new_uri) = new_related_view.uri() { - if let Ok(history_manager) = HISTORY_MANAGER.try_lock() { - history_manager.add_navigation(old_uri.to_string(), new_uri.to_string()); - let current_session = history_manager.get_current_session(); - current_session.update_uri( - old_uri.to_string(), - current_item.uri().map(|x| x.to_string()), - Some(get_title(&new_related_view)), - ); - current_session.save(); - drop(current_session); - drop(history_manager); - } else { - warn!("Could not lock history manager during new tab creation."); - } - } - } - } - } - } new_related_view.into() } ) @@ -2771,27 +2884,20 @@ impl Window { if this.get_view() == *w { back_button.set_sensitive(w.can_go_back()); forward_button.set_sensitive(w.can_go_forward()); - match load_event { - LoadEvent::Redirected => { - if !get_window_from_widget(w).imp().is_private.get() { - if let Some(back_forward_list) = w.back_forward_list() { - if let Some(current_item) = back_forward_list.current_item() { - if let Some(original_uri) = current_item.original_uri() { - if let Ok(history_manager) = HISTORY_MANAGER.try_lock() { - let current_session = history_manager.get_current_session(); - current_session.update_uri(original_uri.to_string(), current_item.uri().map(|x| x.to_string()), Some(title)); - current_session.save(); - drop(current_session); - drop(history_manager); - } else { - warn!("Could not lock history manager during redirection."); - } - } - } - } + } + if !imp.is_private.get() && load_event == LoadEvent::Finished { + if let Some(back_forward_list) = w.back_forward_list() { + if let Some(current_item) = back_forward_list.current_item() { + if let Err(e) = DATABASE.upsert_history_record(HistoryRecord { + id: Uuid::now_v7(), + original_uri: current_item.original_uri().unwrap_or_default().to_string(), + uri: current_item.uri().unwrap_or_default().to_string(), + title: Some(title), + timestamp: chrono::Utc::now() + }) { + error!("{}", e) } } - _ => () } } } @@ -2965,9 +3071,6 @@ impl Window { return; } let old_find_controller = old_view.find_controller().unwrap(); - if let Some(id) = decide_policy.take() { - old_view.disconnect(id); - } if let Some(id) = zoom_level_notify.take() { old_view.disconnect(id); } @@ -3036,7 +3139,7 @@ impl Window { if !config.colour_per_domain() { imp.style_provider.borrow().load_from_string(""); if config.palette() != Palette::None { - self.update_from_palette(&style_manager, &config.palette()); + self.update_from_palette(&web_view, &style_manager, &config.palette()); } return; } else { @@ -3057,13 +3160,15 @@ impl Window { pub fn update_from_palette( &self, + web_view: &webkit2gtk::WebView, style_manager: &libadwaita::StyleManager, palette_colour: &Palette, ) { let imp = self.imp(); let hue = palette_colour.hue(); - let stylesheet = if style_manager.is_dark() { + let is_dark = style_manager.is_dark(); + let stylesheet = if is_dark { format!( " @define-color view_bg_color hsl({hue}, 20%, 8%); @@ -3102,6 +3207,17 @@ impl Window { " ) }; + let rgba = gdk::RGBA::parse(if is_dark { + format!("hsl({hue}, 20%, 8%)") + } else { + format!("hsl({hue}, 100%, 99%)") + }) + .unwrap_or(if is_dark { + gdk::RGBA::BLACK + } else { + gdk::RGBA::WHITE + }); + web_view.set_background_color(&rgba); imp.style_provider.borrow().load_from_string(&stylesheet); } @@ -3131,7 +3247,8 @@ impl Window { }; let hue = hash % 360; - let stylesheet = if style_manager.is_dark() { + let is_dark = style_manager.is_dark(); + let stylesheet = if is_dark { format!( " @define-color view_bg_color hsl({hue}, 20%, 8%); @@ -3170,6 +3287,17 @@ impl Window { " ) }; + let rgba = gdk::RGBA::parse(if is_dark { + format!("hsl({hue}, 20%, 8%)") + } else { + format!("hsl({hue}, 100%, 99%)") + }) + .unwrap_or(if is_dark { + gdk::RGBA::BLACK + } else { + gdk::RGBA::WHITE + }); + web_view.set_background_color(&rgba); imp.style_provider.borrow().load_from_string(&stylesheet); } diff --git a/src/window_util.rs b/src/window_util.rs index 245aeede..205d56da 100644 --- a/src/window_util.rs +++ b/src/window_util.rs @@ -1,7 +1,6 @@ -use crate::HISTORY_MANAGER; use glib::object::{Cast, IsA}; use gtk::{prelude::EditableExt, prelude::WidgetExt}; -use log::{error, warn}; +use log::error; use oku_fs::iroh::docs::{DocTicket, NamespaceId}; use std::{path::PathBuf, str::FromStr}; use webkit2gtk::{functions::uri_for_display, prelude::WebViewExt}; @@ -19,27 +18,19 @@ pub fn connect(nav_entry: >k::SearchEntry, web_view: &webkit2gtk::WebView) { match parsed_url { // When URL is completely OK Ok(_) => { - if let Some(back_forward_list) = web_view.back_forward_list() { - if let Some(current_item) = back_forward_list.current_item() { - if let Some(old_uri) = current_item.original_uri() { - if let Ok(history_manager) = HISTORY_MANAGER.try_lock() { - history_manager - .add_navigation(old_uri.to_string(), nav_text.to_string()); - let current_session = history_manager.get_current_session(); - current_session.update_uri( - old_uri.to_string(), - current_item.uri().map(|x| x.to_string()), - Some(get_title(&web_view)), - ); - current_session.save(); - drop(current_session); - drop(history_manager); - } else { - warn!("Could not lock history manager during navigation."); - } - } - } - } + // if let Some(back_forward_list) = web_view.back_forward_list() { + // if let Some(current_item) = back_forward_list.current_item() { + // if let Err(e) = DATABASE.upsert_history_record(HistoryRecord { + // id: std::ptr::addr_of!(current_item) as usize as u64, + // original_uri: current_item.original_uri().unwrap_or_default().to_string(), + // uri: current_item.uri().unwrap_or_default().to_string(), + // title: Some(get_title(&web_view)), + // timestamp: chrono::Utc::now(), + // }) { + // error!("{}", e) + // } + // } + // } nav_entry.set_text(&nav_text); web_view.load_uri(&nav_text); } @@ -170,6 +161,13 @@ pub fn get_window_from_widget(widget: &impl IsA) -> crate::widgets: .unwrap() } +pub fn get_view_stack_page_by_name( + name: String, + view_stack: &libadwaita::ViewStack, +) -> Option { + view_stack.child_by_name(&name).map(|x| view_stack.page(&x)) +} + /// Update a tab's icon /// /// # Arguments @@ -224,20 +222,20 @@ pub fn get_title(web_view: &webkit2gtk::WebView) -> String { pub fn update_title(tab_view: libadwaita::TabView, web_view: &webkit2gtk::WebView) { let relevant_page = tab_view.page(web_view); let title = get_title(web_view); - if let Some(back_forward_list) = web_view.back_forward_list() { - if let Some(current_item) = back_forward_list.current_item() { - if let Some(original_uri) = current_item.original_uri() { - if let Ok(history_manager) = HISTORY_MANAGER.try_lock() { - let current_session = history_manager.get_current_session(); - current_session.update_uri(original_uri.to_string(), None, Some(title.clone())); - current_session.save(); - drop(current_session); - drop(history_manager); - } else { - warn!("Could not lock history manager during page title change."); - } - } - } - } + // if !get_window_from_widget(web_view).imp().is_private.get() { + // if let Some(back_forward_list) = web_view.back_forward_list() { + // if let Some(current_item) = back_forward_list.current_item() { + // if let Err(e) = DATABASE.upsert_history_record(HistoryRecord { + // id: std::ptr::addr_of!(current_item) as usize as u64, + // original_uri: current_item.original_uri().unwrap_or_default().to_string(), + // uri: current_item.uri().unwrap_or_default().to_string(), + // title: Some(get_title(&web_view)), + // timestamp: chrono::Utc::now(), + // }) { + // error!("{}", e) + // } + // } + // } + // } relevant_page.set_title(&title); }