pub struct QueryResultCacheConfiguration {
pub max_age_ms: i64,
}Expand description
Enables control over how often queries need to be fully re-executed on the backing store. This can be useful in scenarios where API calls might be made frequently, API latency is critical, and some freshness lag (ex: 750ms, 2s, 5s) is tolerable. By default, each query result is returned from cache so long as the result is from an identical query and less than 500ms old. This freshness tolerance can be modified upwards, to a maximum of 900000ms (i.e. 900s, 15m).
JSON schema
{
"title": "Query result cache configuration",
"description": "Enables control over how often queries need to be fully re-executed on the backing store.\nThis can be useful in scenarios where API calls might be made frequently, API latency is critical, and some freshness lag (ex: 750ms, 2s, 5s) is tolerable.\nBy default, each query result is returned from cache so long as the result is from an identical query and less than 500ms old. This freshness tolerance can be modified upwards, to a maximum of 900000ms (i.e. 900s, 15m).\n",
"examples": [
{
"maxAgeMs": 1000
}
],
"type": "object",
"properties": {
"maxAgeMs": {
"description": "The maximum tolerable staleness of the query result cache in milliseconds. If a previous execution result of an identical query is older than this age, the query will be re-executed. If the data is less than this age, the result will be returned from cache.",
"default": 500,
"examples": [
1000
],
"type": "integer",
"maximum": 900000.0,
"minimum": 500.0
}
}
}Fields§
§max_age_ms: i64The maximum tolerable staleness of the query result cache in milliseconds. If a previous execution result of an identical query is older than this age, the query will be re-executed. If the data is less than this age, the result will be returned from cache.
Implementations§
Trait Implementations§
Source§impl Clone for QueryResultCacheConfiguration
impl Clone for QueryResultCacheConfiguration
Source§fn clone(&self) -> QueryResultCacheConfiguration
fn clone(&self) -> QueryResultCacheConfiguration
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<'de> Deserialize<'de> for QueryResultCacheConfiguration
impl<'de> Deserialize<'de> for QueryResultCacheConfiguration
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
Source§impl From<&QueryResultCacheConfiguration> for QueryResultCacheConfiguration
impl From<&QueryResultCacheConfiguration> for QueryResultCacheConfiguration
Source§fn from(value: &QueryResultCacheConfiguration) -> Self
fn from(value: &QueryResultCacheConfiguration) -> Self
Converts to this type from the input type.
Source§impl From<QueryResultCacheConfiguration> for QueryResultCacheConfiguration
impl From<QueryResultCacheConfiguration> for QueryResultCacheConfiguration
Source§fn from(value: QueryResultCacheConfiguration) -> Self
fn from(value: QueryResultCacheConfiguration) -> Self
Converts to this type from the input type.
Source§impl TryFrom<QueryResultCacheConfiguration> for QueryResultCacheConfiguration
impl TryFrom<QueryResultCacheConfiguration> for QueryResultCacheConfiguration
Source§type Error = ConversionError
type Error = ConversionError
The type returned in the event of a conversion error.
Source§fn try_from(
value: QueryResultCacheConfiguration,
) -> Result<Self, ConversionError>
fn try_from( value: QueryResultCacheConfiguration, ) -> Result<Self, ConversionError>
Performs the conversion.
Auto Trait Implementations§
impl Freeze for QueryResultCacheConfiguration
impl RefUnwindSafe for QueryResultCacheConfiguration
impl Send for QueryResultCacheConfiguration
impl Sync for QueryResultCacheConfiguration
impl Unpin for QueryResultCacheConfiguration
impl UnwindSafe for QueryResultCacheConfiguration
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