pub struct Endpoint {
pub url: Uri,
pub api_key: Option<Cow<'static, str>>,
pub timeout_ms: u64,
pub test_token: Option<Cow<'static, str>>,
pub use_system_resolver: bool,
}Fields§
§url: Uri§api_key: Option<Cow<'static, str>>§timeout_ms: u64§test_token: Option<Cow<'static, str>>Sets X-Datadog-Test-Session-Token header on any request
use_system_resolver: boolUse the system DNS resolver when building the HTTP client. If false, the default in-process resolver is used.
Implementations§
Source§impl Endpoint
impl Endpoint
Sourcepub const DEFAULT_TIMEOUT: u64 = 3_000
pub const DEFAULT_TIMEOUT: u64 = 3_000
Default value for the timeout field in milliseconds.
Sourcepub fn get_optional_headers(&self) -> impl Iterator<Item = (&'static str, &str)>
pub fn get_optional_headers(&self) -> impl Iterator<Item = (&'static str, &str)>
Returns an iterator of optional endpoint-specific headers (api-key, test-token) as (header_name, header_value) string tuples for any that are available.
Sourcepub fn to_request_builder(&self, user_agent: &str) -> Result<HttpRequestBuilder>
pub fn to_request_builder(&self, user_agent: &str) -> Result<HttpRequestBuilder>
Return a request builder with the following headers:
- User agent
- Api key
- Container Id/Entity Id
pub fn from_slice(url: &str) -> Endpoint
pub fn from_url(url: Uri) -> Endpoint
pub fn is_file_endpoint(&self) -> bool
Sourcepub fn with_timeout(self, timeout_ms: u64) -> Self
pub fn with_timeout(self, timeout_ms: u64) -> Self
Sourcepub fn with_system_resolver(self, use_system_resolver: bool) -> Self
pub fn with_system_resolver(self, use_system_resolver: bool) -> Self
Use the system DNS resolver when building the reqwest client. Only has effect for HTTP(S) endpoints.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Endpoint
impl<'de> Deserialize<'de> for Endpoint
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
impl Eq for Endpoint
impl StructuralPartialEq for Endpoint
Auto Trait Implementations§
impl !Freeze for Endpoint
impl RefUnwindSafe for Endpoint
impl Send for Endpoint
impl Sync for Endpoint
impl Unpin for Endpoint
impl UnsafeUnpin for Endpoint
impl UnwindSafe for Endpoint
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