pub struct GraphPluginState {
pub entities: RwLock<EntityMap>,
pub lists: RwLock<ListMap>,
pub snapshots: RwLock<SnapshotMap>,
}Expand description
Plugin-managed state, guarded by async RwLock for multi-window safety.
Fields§
§entities: RwLock<EntityMap>§lists: RwLock<ListMap>§snapshots: RwLock<SnapshotMap>Implementations§
Source§impl GraphPluginState
impl GraphPluginState
pub fn new() -> Self
pub async fn upsert_entity( &self, entity_type: &str, entity_id: &str, data: JsonObject, )
pub async fn remove_entity(&self, entity_type: &str, entity_id: &str)
pub async fn get_entity( &self, entity_type: &str, entity_id: &str, ) -> Option<JsonObject>
pub async fn clear_entities(&self)
pub async fn set_list( &self, query_key: &str, ids: Vec<String>, total: Option<i64>, )
pub async fn get_list(&self, query_key: &str) -> Option<ListEntry>
pub async fn clear_lists(&self)
pub async fn set_snapshot(&self, key: &str, snapshot: String)
pub async fn get_snapshot(&self, key: &str) -> Option<String>
Trait Implementations§
Source§impl Debug for GraphPluginState
impl Debug for GraphPluginState
Source§impl Default for GraphPluginState
impl Default for GraphPluginState
Source§fn default() -> GraphPluginState
fn default() -> GraphPluginState
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl !Freeze for GraphPluginState
impl !RefUnwindSafe for GraphPluginState
impl Send for GraphPluginState
impl Sync for GraphPluginState
impl Unpin for GraphPluginState
impl UnwindSafe for GraphPluginState
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