pub struct WorkerOpts {
pub url: String,
pub update_interval: Duration,
}Expand description
Options for configuring the BitfinexWorker.
WorkerOpts provides a way to specify custom values for creating a
BitfinexWorker. It specifies parameters such as the REST API URL and the update interval
for polling, which are used to interact with the Bitfinex REST API.
§Examples
use bothan_bitfinex::worker::opts::WorkerOpts;
use std::time::Duration;
let opts = WorkerOpts {
url: "https://api-pub.bitfinex.com/v2/".to_string(),
update_interval: Duration::from_secs(30),
};
// Or use defaults
let opts = WorkerOpts::default();Fields§
§url: StringThe base URL for the worker’s REST API connection. If not provided, a default URL will be used.
update_interval: DurationThe interval between REST API polling requests for asset updates. If not specified, a default value will be used.
Trait Implementations§
Source§impl Clone for WorkerOpts
impl Clone for WorkerOpts
Source§fn clone(&self) -> WorkerOpts
fn clone(&self) -> WorkerOpts
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for WorkerOpts
impl Debug for WorkerOpts
Source§impl Default for WorkerOpts
impl Default for WorkerOpts
Source§fn default() -> Self
fn default() -> Self
Creates a new WorkerOpts with default values.
This method initializes the configuration with:
- Default Bitfinex REST API URL
- Default update interval for polling
§Returns
A WorkerOpts instance with default settings
§Examples
use bothan_bitfinex::worker::opts::WorkerOpts;
let opts = WorkerOpts::default();
assert_eq!(opts.url, "https://api-pub.bitfinex.com/v2/");
assert_eq!(opts.update_interval.as_secs(), 60);Source§impl<'de> Deserialize<'de> for WorkerOpts
impl<'de> Deserialize<'de> for WorkerOpts
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for WorkerOpts
impl RefUnwindSafe for WorkerOpts
impl Send for WorkerOpts
impl Sync for WorkerOpts
impl Unpin for WorkerOpts
impl UnwindSafe for WorkerOpts
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request