diff --git a/rust/iroh-streamplace/src/node/db.rs b/rust/iroh-streamplace/src/db.rs similarity index 100% rename from rust/iroh-streamplace/src/node/db.rs rename to rust/iroh-streamplace/src/db.rs diff --git a/rust/iroh-streamplace/src/node/db/kv/subscribe_mode.rs b/rust/iroh-streamplace/src/db/kv/subscribe_mode.rs similarity index 100% rename from rust/iroh-streamplace/src/node/db/kv/subscribe_mode.rs rename to rust/iroh-streamplace/src/db/kv/subscribe_mode.rs diff --git a/rust/iroh-streamplace/src/node/db/kv/time_bound.rs b/rust/iroh-streamplace/src/db/kv/time_bound.rs similarity index 100% rename from rust/iroh-streamplace/src/node/db/kv/time_bound.rs rename to rust/iroh-streamplace/src/db/kv/time_bound.rs diff --git a/rust/iroh-streamplace/src/lib.rs b/rust/iroh-streamplace/src/lib.rs index 2c4fb848..370d94e0 100644 --- a/rust/iroh-streamplace/src/lib.rs +++ b/rust/iroh-streamplace/src/lib.rs @@ -1,6 +1,19 @@ uniffi::setup_scaffolding!(); pub mod c2pa; -pub mod node; pub mod node_addr; pub mod public_key; + +use std::sync::LazyLock; + +/// We export the entire API at top level since this is what go-uniffi-bindgen will do anyway. +mod streams; +pub use streams::*; +mod db; +pub use db::*; +#[cfg(test)] +mod tests; + +/// Lazily initialized Tokio runtime for use in uniffi methods that need a runtime. +static RUNTIME: LazyLock = + LazyLock::new(|| tokio::runtime::Runtime::new().unwrap()); diff --git a/rust/iroh-streamplace/src/node/mod.rs b/rust/iroh-streamplace/src/node/mod.rs deleted file mode 100644 index f625025a..00000000 --- a/rust/iroh-streamplace/src/node/mod.rs +++ /dev/null @@ -1,13 +0,0 @@ -use std::sync::LazyLock; - -/// We export the entire API at top level since this is what go-uniffi-bindgen will do anyway. -mod streams; -pub use streams::*; -mod db; -pub use db::*; -#[cfg(test)] -mod tests; - -/// Lazily initialized Tokio runtime for use in uniffi methods that need a runtime. -static RUNTIME: LazyLock = - LazyLock::new(|| tokio::runtime::Runtime::new().unwrap()); diff --git a/rust/iroh-streamplace/src/node/streams.rs b/rust/iroh-streamplace/src/streams.rs similarity index 99% rename from rust/iroh-streamplace/src/node/streams.rs rename to rust/iroh-streamplace/src/streams.rs index 37be96d5..620487ec 100644 --- a/rust/iroh-streamplace/src/node/streams.rs +++ b/rust/iroh-streamplace/src/streams.rs @@ -10,7 +10,7 @@ use iroh_base::ticket::NodeTicket; use iroh_gossip::{net::Gossip, proto::TopicId}; use irpc::{WithChannels, rpc::RemoteService}; use irpc_iroh::{IrohProtocol, IrohRemoteConnection}; -use n0_future::{TryFutureExt, future::Boxed}; +use n0_future::future::Boxed; mod rpc { //! Protocol API @@ -133,11 +133,10 @@ use api::{Message as ApiMessage, Protocol as ApiProtocol}; use n0_future::{FuturesUnordered, StreamExt}; use rpc::{Message as RpcMessage, Protocol as RpcProtocol}; use snafu::Snafu; -use tokio::sync::oneshot; use tracing::{Instrument, debug, error, trace, trace_span, warn}; use super::{Config, CreateError, JoinPeersError, PutError, db, streams::rpc::RecvSegment}; -use crate::node::ShutdownError; +use crate::ShutdownError; pub(crate) enum HandlerMode { Sender, diff --git a/rust/iroh-streamplace/src/node/tests.rs b/rust/iroh-streamplace/src/tests.rs similarity index 100% rename from rust/iroh-streamplace/src/node/tests.rs rename to rust/iroh-streamplace/src/tests.rs