Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 10 additions & 6 deletions crates/socketioxide-core/src/adapter/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ pub mod heartbeat;
#[cfg(feature = "remote-adapter")]
pub mod remote_packet;
#[cfg(feature = "remote-adapter")]
pub mod request;
#[cfg(feature = "remote-adapter")]
pub mod stream;

/// A room identifier
Expand Down Expand Up @@ -726,7 +728,7 @@ pub struct RemoteSocketData {
}

#[cfg(test)]
mod test {
pub(crate) mod test {

use smallvec::smallvec;
use std::{
Expand All @@ -737,12 +739,12 @@ mod test {

use super::*;

struct StubSockets {
pub(crate) struct StubSockets {
sockets: HashSet<Sid>,
path: Str,
}
impl StubSockets {
fn new(sockets: &[Sid]) -> Self {
pub(crate) fn new(sockets: &[Sid]) -> Self {
let sockets = HashSet::from_iter(sockets.iter().copied());
Self {
sockets,
Expand All @@ -751,7 +753,7 @@ mod test {
}
}

struct StubAckStream;
pub(crate) struct StubAckStream;
impl Stream for StubAckStream {
type Item = (Sid, Result<Value, StubError>);
fn poll_next(self: Pin<&mut Self>, _: &mut Context<'_>) -> Poll<Option<Self::Item>> {
Expand All @@ -764,7 +766,7 @@ mod test {
}
}
#[derive(Debug, Serialize, Deserialize)]
struct StubError;
pub(crate) struct StubError;
impl std::fmt::Display for StubError {
fn fmt(&self, _: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
Ok(())
Expand Down Expand Up @@ -825,7 +827,9 @@ mod test {
}
}

fn create_adapter<const S: usize>(sockets: [Sid; S]) -> CoreLocalAdapter<StubSockets> {
pub(crate) fn create_adapter<const S: usize>(
sockets: [Sid; S],
) -> CoreLocalAdapter<StubSockets> {
CoreLocalAdapter::new(StubSockets::new(&sockets))
}

Expand Down
Loading