Skip to content

Commit

Permalink
doc: fix grammar and typos
Browse files Browse the repository at this point in the history
  • Loading branch information
Totodore committed Dec 22, 2024
1 parent 52086e7 commit 78fb8cf
Show file tree
Hide file tree
Showing 17 changed files with 21 additions and 22 deletions.
2 changes: 1 addition & 1 deletion crates/engineioxide/src/sid.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//! [`Socket`](crate::Socket) id type and generator
//!
//! It it stored as a 128 bit id and it represent a base64 16 char string
//! It is stored as a 128-bit id and it represent a base64 16 char string
use std::{
fmt::{Debug, Display, Formatter},
str::FromStr,
Expand Down
4 changes: 2 additions & 2 deletions crates/engineioxide/src/socket.rs
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ where
///
/// It is locked if [`EngineIo`](crate::engine) is currently reading from it :
/// * In case of polling transport it will be locked and released for each request
/// * In case of websocket transport it will be always locked until the connection is closed
/// * In case of websocket transport it will always be locked until the connection is closed
///
/// It will be closed when a [`Close`](Packet::Close) packet is received:
/// * From the [encoder](crate::service::encoder) if the transport is polling
Expand Down Expand Up @@ -301,7 +301,7 @@ where
.replace(handle);
}

/// Heartbeat is sent every `interval` milliseconds by the client and the server is expected to respond within `timeout` milliseconds.
/// Heartbeat is sent every `interval` milliseconds by the client and the server `is` expected to respond within `timeout` milliseconds.
///
/// If the client or server does not respond within the timeout, the connection is closed.
#[cfg(feature = "v3")]
Expand Down
2 changes: 1 addition & 1 deletion crates/engineioxide/src/transport/polling/payload/buf.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
//! Buffer utilities.
//! The Buf list is used to store the data from the body of the request in a zero-copy fashion.
//! Each time a new chunk of data is received, it is pushed to the back of the list.
//! It the implement the `Buf` trait itself so that it can be used as a `Buf` in the `Payload` struct.
//! It implements the `Buf` trait itself so that it can be used as a `Buf` in the `Payload` struct.
//!
//! This implementation is based on the private [`BufList`](https://github.com/hyperium/hyper/blob/d977f209bc6068d8f878b22803fc42d90c887fcc/src/common/buf.rs) mod from the [`hyper`](hyper) crate.
use std::collections::VecDeque;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//! ## Decodes the payload stream into packets
//!
//! There is two versions of the decoder:
//! There are two versions of the decoder:
//! - v4_decoder: Decodes the payload stream according to the [engine.io v4 protocol](https://socket.io/fr/docs/v4/engine-io-protocol/#http-long-polling-1)
//! - v3_decoder: Decodes the payload stream according to the [engine.io v3 protocol](https://github.com/socketio/engine.io-protocol/tree/v3#payload)
//!
Expand Down
4 changes: 2 additions & 2 deletions crates/engineioxide/src/transport/polling/payload/encoder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
//! * engine.io v4 encoder
//! * engine.io v3 encoder:
//! * string encoder (used when there is no binary packet or when the client does not support binary)
//! * binary encoder (used when there is binary packets and the client supports binary)
//! * binary encoder (used when there are binary packets and the client supports binary)
//!
use tokio::sync::MutexGuard;
Expand Down Expand Up @@ -167,7 +167,7 @@ pub fn v3_string_packet_encoder(packet: Packet, data: &mut bytes::BytesMut) -> R
Ok(())
}

/// Encode multiple packet packet into a *string* payload if there is no binary packet or into a *binary* payload if there is binary packets
/// Encode multiple packet packet into a *string* payload if there is no binary packet or into a *binary* payload if there are binary packets
/// according to the [engine.io v3 protocol](https://github.com/socketio/engine.io-protocol/tree/v3#payload)
#[cfg(feature = "v3")]
pub async fn v3_binary_encoder(
Expand Down
2 changes: 1 addition & 1 deletion crates/socketioxide/src/ack.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ pin_project_lite::pin_project! {
///
/// It can be used in two ways:
/// * As a [`Stream`]: It will yield all the ack responses with their corresponding socket id
/// received from the client. It can useful when broadcasting to multiple sockets and therefore expecting
/// received from the client. It can be useful when broadcasting to multiple sockets and therefore expecting
/// more than one acknowledgement.
/// * As a [`Future`]: It will yield the first ack response received from the client.
/// Useful when expecting only one acknowledgement.
Expand Down
2 changes: 1 addition & 1 deletion crates/socketioxide/src/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ impl<A: Adapter> Client<A> {
}
}

/// Propagate a packet to a its target namespace
/// Propagate a packet to its target namespace
fn sock_propagate_packet(&self, packet: Packet, sid: Sid) -> Result<(), Error> {
if let Some(ns) = self.get_ns(&packet.ns) {
ns.recv(sid, packet.inner)
Expand Down
6 changes: 3 additions & 3 deletions crates/socketioxide/src/extensions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ impl Extensions {
}
}

/// Insert a type into this `Extensions`.
/// Insert a type into the `Extensions`.
///
/// The type must be cloneable and thread safe to be stored.
///
Expand All @@ -95,7 +95,7 @@ impl Extensions {
.and_then(|v| v.downcast().ok().map(|boxed| *boxed))
}

/// Get a cloned value of a type previously inserted on this `Extensions`.
/// Get a cloned value of a type previously inserted in the `Extensions`.
///
/// # Example
///
Expand All @@ -116,7 +116,7 @@ impl Extensions {
.cloned()
}

/// Remove a type from this `Extensions`.
/// Remove a type from the `Extensions`.
///
/// If a extension of this type existed, it will be returned.
///
Expand Down
2 changes: 1 addition & 1 deletion crates/socketioxide/src/handler/disconnect.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
//! });
//! ```
//!
//! ## Example with async non anonymous functions
//! ## Example with an async non-anonymous functions
//! ```rust
//! # use socketioxide::SocketIo;
//! # use socketioxide::extract::*;
Expand Down
2 changes: 1 addition & 1 deletion crates/socketioxide/src/handler/message.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
//! });
//! ```
//!
//! ## Example with async non anonymous handler
//! ## Example with an async non-anonymous handler
//! ```rust
//! # use socketioxide::SocketIo;
//! # use socketioxide::extract::*;
Expand Down
2 changes: 1 addition & 1 deletion crates/socketioxide/src/handler/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ pub(crate) use message::BoxedMessageHandler;
pub use message::{FromMessage, FromMessageParts, MessageHandler};
pub use socketioxide_core::Value;

/// A struct used to erase the type of a [`ConnectHandler`] or [`MessageHandler`] so it can be stored in a map
/// A struct used to erase the type of [`ConnectHandler`] or [`MessageHandler`] so it can be stored in a map
pub(crate) struct MakeErasedHandler<H, A, T> {
handler: H,
adapter: std::marker::PhantomData<A>,
Expand Down
3 changes: 1 addition & 2 deletions crates/socketioxide/src/ns.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,7 @@ impl<A: Adapter> Namespace<A> {
///
/// Middlewares are first called to check if the connection is allowed.
/// * If the handler returns an error, a connect_error packet is sent to the client.
/// * If the handler returns Ok, a connect packet is sent to the client
/// and the handler is called.
/// * If the handler returns Ok, a connect packet is sent to the client and the handler `is` called.
pub(crate) async fn connect(
self: Arc<Self>,
sid: Sid,
Expand Down
2 changes: 1 addition & 1 deletion crates/socketioxide/src/operators.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
//!
//! They use the builder pattern to chain operators.
//!
//! There is two types of operators:
//! There are two types of operators:
//! * [`ConfOperators`]: Chainable operators to configure the message to be sent.
//! * [`BroadcastOperators`]: Chainable operators to select sockets to send a message to and to configure the message to be sent.
use std::borrow::Cow;
Expand Down
2 changes: 1 addition & 1 deletion crates/socketioxide/src/service.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
//! ## A Tower [`Service`](tower_service::Service) and Hyper [`Service`](hyper::service::Service) for socket.io so it
//! can be used with frameworks supporting tower and hyper services.
//!
//! #### Example with a raw `hyper` standalone service (most of the time it easier to use a framework like `axum` or `salvo`):
//! #### Example with a raw `hyper` standalone service (most of the time it is easier to use a framework like `axum` or `salvo`):
//!
//! ```no_run
//! # use socketioxide::SocketIo;
Expand Down
2 changes: 1 addition & 1 deletion crates/socketioxide/src/socket.rs
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ pub struct Socket<A: Adapter = LocalAdapter> {
/// A type map of protocol extensions.
/// It can be used to share data through the lifetime of the socket.
///
/// **Note**: This is note the same data than the `extensions` field on the [`http::Request::extensions()`](http::Request) struct.
/// **Note**: This is not the same data as the `extensions` field on the [`http::Request::extensions()`](http::Request) struct.
/// If you want to extract extensions from the http request, you should use the [`HttpExtension`](crate::extract::HttpExtension) extractor.
#[cfg_attr(docsrs, doc(cfg(feature = "extensions")))]
#[cfg(feature = "extensions")]
Expand Down
2 changes: 1 addition & 1 deletion e2e/engineioxide/engineioxide.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//! This a end to end test server used with this [test suite](https://github.com/socketio/engine.io-protocol)
//! This is a end-to-end test server used with this [test suite](https://github.com/socketio/engine.io-protocol)
use std::{sync::Arc, time::Duration};

Expand Down
2 changes: 1 addition & 1 deletion e2e/socketioxide/socketioxide.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//! This a end to end test server used with this [test suite](https://github.com/socketio/socket.io-protocol)
//! This is a end-to-end test server used with this [test suite](https://github.com/socketio/socket.io-protocol)
use std::time::Duration;

Expand Down

0 comments on commit 78fb8cf

Please sign in to comment.