pub struct ObjectStore { /* private fields */ }Expand description
Thread-safe property store backed by Mutex<HashMap<ObjectId, HashMap<PropertyId, ClientDataValue>>>.
Implementations§
Source§impl ObjectStore
impl ObjectStore
Sourcepub fn set(
&self,
object_id: ObjectId,
property_id: PropertyId,
value: ClientDataValue,
)
pub fn set( &self, object_id: ObjectId, property_id: PropertyId, value: ClientDataValue, )
Insert or overwrite a property value.
Sourcepub fn get(
&self,
object_id: ObjectId,
property_id: PropertyId,
) -> Option<ClientDataValue>
pub fn get( &self, object_id: ObjectId, property_id: PropertyId, ) -> Option<ClientDataValue>
Retrieve a property value, returning None if the object or property is absent.
Sourcepub fn remove_object(&self, object_id: ObjectId)
pub fn remove_object(&self, object_id: ObjectId)
Remove all properties associated with an object.
Sourcepub fn object_ids(&self) -> Vec<ObjectId>
pub fn object_ids(&self) -> Vec<ObjectId>
Return a snapshot of all known object identifiers.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for ObjectStore
impl RefUnwindSafe for ObjectStore
impl Send for ObjectStore
impl Sync for ObjectStore
impl Unpin for ObjectStore
impl UnsafeUnpin for ObjectStore
impl UnwindSafe for ObjectStore
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