#[non_exhaustive]pub enum FlushMode {
Sync,
Async,
}Expand description
SCRIPT FLUSH mode (Redis 6.2+ semantics). The default is
FlushMode::Sync, what SCRIPT FLUSH without an argument means.
assert_eq!(kevy_lua::FlushMode::default(), kevy_lua::FlushMode::Sync);Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Sync
Synchronous — drop the cache before returning.
let mut b = kevy_lua::Bridge::with_no_dispatch();
let sha = b.script_load(b"return 1");
b.script_flush(kevy_lua::FlushMode::Sync);
assert_eq!(b.script_exists(&[sha]), [false]);Async
Asynchronous — schedule the cache drop. Currently both modes run as Sync; we keep the tag for future differentiation (and Redis-compat replies).
let mut b = kevy_lua::Bridge::with_no_dispatch();
let sha = b.script_load(b"return 1");
b.script_flush(kevy_lua::FlushMode::Async);
// the cache is already empty when the call returns
assert_eq!(b.script_exists(&[sha]), [false]);Trait Implementations§
impl Copy for FlushMode
impl Eq for FlushMode
impl StructuralPartialEq for FlushMode
Auto Trait Implementations§
impl Freeze for FlushMode
impl RefUnwindSafe for FlushMode
impl Send for FlushMode
impl Sync for FlushMode
impl Unpin for FlushMode
impl UnsafeUnpin for FlushMode
impl UnwindSafe for FlushMode
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