couchbase_core/options/
ping.rs1use crate::httpx::request::OnBehalfOfInfo;
20use crate::service_type::ServiceType;
21use std::fmt::Display;
22
23#[derive(Debug, Default, Clone)]
24#[non_exhaustive]
25pub struct PingOptions {
26 pub service_types: Option<Vec<ServiceType>>,
27
28 pub kv_timeout: Option<std::time::Duration>,
29 pub query_timeout: Option<std::time::Duration>,
30 pub search_timeout: Option<std::time::Duration>,
31
32 pub on_behalf_of: Option<OnBehalfOfInfo>,
33}
34
35impl PingOptions {
36 pub fn new() -> Self {
37 Self::default()
38 }
39
40 pub fn service_types(mut self, service_types: Vec<ServiceType>) -> Self {
41 self.service_types = Some(service_types);
42 self
43 }
44
45 pub fn kv_timeout(mut self, timeout: std::time::Duration) -> Self {
46 self.kv_timeout = Some(timeout);
47 self
48 }
49
50 pub fn query_timeout(mut self, timeout: std::time::Duration) -> Self {
51 self.query_timeout = Some(timeout);
52 self
53 }
54
55 pub fn search_timeout(mut self, timeout: std::time::Duration) -> Self {
56 self.search_timeout = Some(timeout);
57 self
58 }
59
60 pub fn on_behalf_of(mut self, info: Option<OnBehalfOfInfo>) -> Self {
61 self.on_behalf_of = info;
62 self
63 }
64}