Skip to content

Commit 3e87d52

Browse files
committed
Minor doc fixes
1 parent 8b3d42c commit 3e87d52

File tree

3 files changed

+10
-8
lines changed

3 files changed

+10
-8
lines changed

crates/smb-fscc/src/chained_item.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -132,14 +132,14 @@ where
132132

133133
/// Implements a chained item list.
134134
///
135-
/// A Chained item list is a sequence of ChainedItem<T> entries,
136-
/// where each entry contains a value of type T and an offset to the next entry.
137-
/// The last entry in the list has a next entry offset of 0.
135+
/// A chained item list is a sequence of [`ChainedItem<T>`] entries,
136+
/// where each entry contains a value of type `T` and an offset to the next entry.
137+
/// The last entry in the list has a next entry offset of `0`.
138138
///
139139
/// This is a common pattern for Microsoft fscc-query responses, and is used to
140140
/// represent lists of variable-length entries.
141141
///
142-
/// This struct provides conversion to and from Vec<T> for ease of use.
142+
/// This struct provides conversion to and from [`Vec<T>`] for ease of use.
143143
#[binrw::binrw]
144144
#[derive(Debug, PartialEq, Eq)]
145145
pub struct ChainedItemList<T, const OFFSET_PAD: u32 = DEFAULT_OFFSET_PAD>

crates/smb/docs/parallelize.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,11 @@ One of the most challenging aspects of working with SMB is achieving efficient p
44

55
## Background: The SMB protocol
66

7-
The SMB protocol supports (in most of the newer SMB2 dialects), the "large MTU" feature. This feature basically allows sending multiple requests to the server at once, without having to wait for each individual response between reequests. This is implemented by a credit system -- the client asks the server to grant N credits, and each message consumes some of those credits - depending on the message size and type.
8-
This great feature is also supported in this crate: If you are building the crate with the "async" or the "multi_threaded" features, you can share your SMB resources between threads to allow concurrent access and proper initialization of the available network bandwidth, by sending requests and processing informations even when awaiting for responses to get back.
9-
The credits system is implemented per-connection -- and therefore, you should only have ONE connection between your client and a certain server. In case you have multiple network adapters, that possibly allow improving your bandwidth by connecting to multiple endpoints (i.,e. esatbilishing multiple connections bwteen the same client and server, on different network adapters) - SMB has a solution for that too, which is called multi-channel.
7+
The SMB protocol, especially in newer SMB2 dialects, supports the "large MTU" feature. This allows clients to send multiple requests to the server simultaneously, without waiting for individual responses between requests. The mechanism is managed by a credit system: the client requests a number of credits from the server, and each message consumes credits based on its size and type.
8+
9+
This crate fully supports this feature. When built with the "async" or "multi_threaded" options, you can share SMB resources between threads, enabling concurrent access and efficient utilization of available network bandwidth. Requests can be sent and processed even while awaiting responses.
10+
11+
Credits are managed per connection, so you should maintain a single connection between your client and each server. If you have multiple network adapters and want to maximize bandwidth by connecting to multiple endpoints (i.e., establishing multiple connections between the same client and server on different adapters), SMB provides a solution called multi-channel.
1012

1113
## Practice: How should I do it?
1214

crates/smb/docs/threading_models.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ async fn do_main() -> Result<(), Box<dyn std::error::Error>> {
6363
}
6464
```
6565

66-
In this case, the main function is special, since we use `tokio::main` to invoke the async main through the tokio runtime. The same goes when implementing your code, and simple elimintaion of `async` and `await` is not enough to adapt the code from async to sync.
66+
In this case, the main function is special, since we use `tokio::main` to invoke the async main through the tokio runtime. The same goes when implementing your code, and simple elimination of `async` and `await` is not enough to adapt the code from async to sync.
6767

6868
## Choosing a Threading Model
6969

0 commit comments

Comments
 (0)