pub enum Ttl {
None,
Forever,
Milliseconds(f64),
String(String),
}Expand description
How long a query stays cached after its last use.
Forever and negative durations never expire, None expires
immediately. Durations are clamped to 10 minutes when sent to the server.
Variants§
None
Expires as soon as nothing uses the query.
Forever
Never expires.
Milliseconds(f64)
A duration in milliseconds.
String(String)
A duration string as JS accepts it: a number followed by s, m,
h, d, or y (for example "5m").
Implementations§
Source§impl Ttl
impl Ttl
Sourcepub const DEFAULT_PRELOAD: Ttl = Ttl::None
pub const DEFAULT_PRELOAD: Ttl = Ttl::None
The TTL JS’s preload uses when it isn’t given one: the query
stops being synced as soon as its preload is cleaned up.
Ttl::default is the default of views and run.
Sourcepub fn normalized(&self) -> Ttl
pub fn normalized(&self) -> Ttl
normalizeTTL: the shortest equivalent spelling of a number of
milliseconds; strings are returned as is.
Trait Implementations§
impl StructuralPartialEq for Ttl
Auto Trait Implementations§
impl Forget for Ttl
impl Freeze for Ttl
impl Move for Ttl
impl RefUnwindSafe for Ttl
impl Send for Ttl
impl Sync for Ttl
impl Unpin for Ttl
impl UnsafeUnpin for Ttl
impl UnwindSafe for Ttl
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