Skip to content

Commit

Permalink
Add warning on clamping timeouts to documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
sirhcel committed Aug 2, 2024
1 parent f5f1703 commit 967916f
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -375,6 +375,14 @@ impl SerialPortBuilder {
}

/// Set the amount of time to wait to receive data before timing out
///
/// <div class="warning">
///
/// The accuracy is limited by the underlying platform's capabilities. Longer timeouts will be
/// clamped to the maximum supported value which is expected to be in the magnitude of a few
/// days.
///
/// </div>
#[must_use]
pub fn timeout(mut self, timeout: Duration) -> Self {
self.timeout = timeout;
Expand Down Expand Up @@ -487,6 +495,14 @@ pub trait SerialPort: Send + io::Read + io::Write {
fn set_stop_bits(&mut self, stop_bits: StopBits) -> Result<()>;

/// Sets the timeout for future I/O operations.
///
/// <div class="warning">
///
/// The accuracy is limited by the underlying platform's capabilities. Longer timeouts will be
/// clamped to the maximum supported value which is expected to be in the magnitude of a few
/// days.
///
/// </div>
fn set_timeout(&mut self, timeout: Duration) -> Result<()>;

// Functions for setting non-data control signal pins
Expand Down

0 comments on commit 967916f

Please sign in to comment.