pub struct Storage { /* private fields */ }Implementations§
Source§impl Storage
impl Storage
pub fn new(config_dir: Option<&str>) -> Result<Self>
pub fn load_rooms(&self) -> Result<RoomStorage>
pub fn save_rooms(&self, storage: &RoomStorage) -> Result<()>
pub fn add_room( &self, owner_vk: &VerifyingKey, signing_key: &SigningKey, state: ChatRoomStateV1, contract_key: &ContractKey, ) -> Result<()>
pub fn get_room( &self, owner_vk: &VerifyingKey, ) -> Result<Option<(SigningKey, ChatRoomStateV1, String)>>
pub fn update_room_state( &self, owner_vk: &VerifyingKey, state: ChatRoomStateV1, ) -> Result<()>
Sourcepub fn update_contract_key(
&self,
owner_vk: &VerifyingKey,
new_key: &ContractKey,
) -> Result<()>
pub fn update_contract_key( &self, owner_vk: &VerifyingKey, new_key: &ContractKey, ) -> Result<()>
Update the contract key for a room (used during migration to new contract version)
pub fn list_rooms(&self) -> Result<Vec<(VerifyingKey, String, String)>>
Auto Trait Implementations§
impl Freeze for Storage
impl RefUnwindSafe for Storage
impl Send for Storage
impl Sync for Storage
impl Unpin for Storage
impl UnsafeUnpin for Storage
impl UnwindSafe for Storage
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