teamtalk 6.0.0

TeamTalk SDK for Rust
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
#![cfg(feature = "bot-sqlite")]

use teamtalk::{SqliteStateStore, StateStore};

#[test]
fn sqlite_store_roundtrip() {
    let mut store = SqliteStateStore::in_memory().expect("sqlite in-memory");
    store.set("dialog:user:1".to_owned(), "await_code".to_owned());
    assert_eq!(store.get("dialog:user:1").as_deref(), Some("await_code"));
    assert_eq!(store.remove("dialog:user:1").as_deref(), Some("await_code"));
    assert!(store.get("dialog:user:1").is_none());
}