pub struct CommandAcknowledgement { /* private fields */ }Expand description
The execution of every write operation is returned a CommandAcknowledgement wrapped inside crate::cache::command::command_executor::CommandSendResult.
CommandAcknowledgement provides a handle to the clients to perform .await to get the command status.
use tinylfu_cached::cache::cached::CacheD;
use tinylfu_cached::cache::command::CommandStatus;
use tinylfu_cached::cache::config::ConfigBuilder;
#[tokio::main]
async fn main() {
let cached = CacheD::new(ConfigBuilder::new(100, 10, 100).build());
let status = cached.put("topic", "microservices").unwrap().handle().await;
assert_eq!(CommandStatus::Accepted, status);
let value = cached.get(&"topic");
assert_eq!(Some("microservices"), value);
}Implementations§
Source§impl CommandAcknowledgement
CommandAcknowledgement provides a handle() method that returns a reference to the CommandAcknowledgementHandle
impl CommandAcknowledgement
CommandAcknowledgement provides a handle() method that returns a reference to the CommandAcknowledgementHandle
pub fn handle(&self) -> &CommandAcknowledgementHandle ⓘ
Auto Trait Implementations§
impl !Freeze for CommandAcknowledgement
impl !RefUnwindSafe for CommandAcknowledgement
impl Send for CommandAcknowledgement
impl Sync for CommandAcknowledgement
impl Unpin for CommandAcknowledgement
impl !UnwindSafe for CommandAcknowledgement
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