pub struct Region { /* private fields */ }Expand description
The settings for one model’s cache.
Implementations§
Source§impl Region
impl Region
pub fn new() -> Region
Sourcepub fn read_only() -> Region
pub fn read_only() -> Region
A region for data that is never written to. Needs a TTL — see
Strategy::ReadOnly.
pub fn ttl(self, ttl: Duration) -> Region
Sourcepub fn forever(self) -> Region
pub fn forever(self) -> Region
Keep entries until something invalidates them.
Refused for a read-only region, where nothing ever does.
Sourcepub fn entities_only(self) -> Region
pub fn entities_only(self) -> Region
Cache entities by key, but not query results.
Sourcepub fn queries_only(self) -> Region
pub fn queries_only(self) -> Region
Cache query results, but not entities.
pub fn max_rows(self, rows: usize) -> Region
pub fn strategy(&self) -> Strategy
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Region
impl RefUnwindSafe for Region
impl Send for Region
impl Sync for Region
impl Unpin for Region
impl UnsafeUnpin for Region
impl UnwindSafe for Region
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