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.
pub fn agentless(site: &str, api_key: String) -> Result<Endpoint, Error>
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 set_standard_headers(
&self,
builder: Builder,
user_agent: &str,
) -> Builder
pub fn set_standard_headers( &self, builder: Builder, user_agent: &str, ) -> Builder
Apply standard headers (user-agent, api-key, test-token, entity headers) to an
http::request::Builder.
Sourcepub fn to_request_builder(&self, user_agent: &str) -> Result<Builder, Error>
pub fn to_request_builder(&self, user_agent: &str) -> Result<Builder, Error>
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) -> Endpoint
pub fn with_timeout(self, timeout_ms: u64) -> Endpoint
Sourcepub fn with_system_resolver(self, use_system_resolver: bool) -> Endpoint
pub fn with_system_resolver(self, use_system_resolver: bool) -> Endpoint
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<Endpoint, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<Endpoint, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for Endpoint
Source§impl Serialize for Endpoint
impl Serialize for Endpoint
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.