Skip to content

Commit

Permalink
feat: add methods to builder for changing timeouts (#498)
Browse files Browse the repository at this point in the history
* feat: add methods to builder for changing timeouts

* chore: remove unnecessary feature flag
  • Loading branch information
johnrichardrinehart committed Jan 15, 2024
1 parent e3e9780 commit ee49f5c
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -485,6 +485,24 @@ impl OctocrabBuilder<NoSvc, DefaultOctocrabBuilderConfig, NoAuth, NotLayerReady>
self
}

/// Set the connect timeout.
pub fn set_connect_timeout(mut self, timeout: Option<Duration>) -> Self {
self.config.connect_timeout = timeout;
self
}

/// Set the read timeout.
pub fn set_read_timeout(mut self, timeout: Option<Duration>) -> Self {
self.config.read_timeout = timeout;
self
}

/// Set the write timeout.
pub fn set_write_timeout(mut self, timeout: Option<Duration>) -> Self {
self.config.write_timeout = timeout;
self
}

/// Enable a GitHub preview.
pub fn add_preview(mut self, preview: &'static str) -> Self {
self.config.previews.push(preview);
Expand Down

0 comments on commit ee49f5c

Please sign in to comment.