pub struct GetOptionsBuilder { /* private fields */ }
Expand description
A builder to configure get requests.
Implementations§
Source§impl GetOptionsBuilder
impl GetOptionsBuilder
Sourcepub fn cache_ttl(self, cache_ttl: u64) -> Self
pub fn cache_ttl(self, cache_ttl: u64) -> Self
The cache_ttl parameter must be an integer that is greater than or equal to 60. It defines the length of time in seconds that a KV result is cached in the edge location that it is accessed from. This can be useful for reducing cold read latency on keys that are read relatively infrequently. It is especially useful if your data is write-once or write-rarely, but is not recommended if your data is updated often and you need to see updates shortly after they’re written, because writes that happen from other edge locations won’t be visible until the cached value expires.
Sourcepub async fn json<T>(self) -> Result<Option<T>, KvError>where
T: DeserializeOwned,
pub async fn json<T>(self) -> Result<Option<T>, KvError>where
T: DeserializeOwned,
Tries to deserialize the inner text to the generic type.
Sourcepub async fn text_with_metadata<M>(
self,
) -> Result<(Option<String>, Option<M>), KvError>where
M: DeserializeOwned,
pub async fn text_with_metadata<M>(
self,
) -> Result<(Option<String>, Option<M>), KvError>where
M: DeserializeOwned,
Gets the value as a string and it’s associated metadata.
Sourcepub async fn json_with_metadata<T, M>(
self,
) -> Result<(Option<T>, Option<M>), KvError>where
T: DeserializeOwned,
M: DeserializeOwned,
pub async fn json_with_metadata<T, M>(
self,
) -> Result<(Option<T>, Option<M>), KvError>where
T: DeserializeOwned,
M: DeserializeOwned,
Tries to deserialize the inner text to the generic type along with it’s metadata.
Sourcepub async fn bytes_with_metadata<M>(
self,
) -> Result<(Option<Vec<u8>>, Option<M>), KvError>where
M: DeserializeOwned,
pub async fn bytes_with_metadata<M>(
self,
) -> Result<(Option<Vec<u8>>, Option<M>), KvError>where
M: DeserializeOwned,
Gets the value as a byte slice and it’s associated metadata.
Trait Implementations§
Source§impl Clone for GetOptionsBuilder
impl Clone for GetOptionsBuilder
Source§fn clone(&self) -> GetOptionsBuilder
fn clone(&self) -> GetOptionsBuilder
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more