pub struct Store {
pub overlay_id: OverlayId,
/* private fields */
}
Fields§
§overlay_id: OverlayId
Implementations§
Source§impl Store
impl Store
pub fn new_temp_in_mem() -> Self
pub fn new_from_overlay_id( overlay: &OverlayId, storage: Arc<RwLock<dyn BlockStorage + Send + Sync>>, ) -> Store
pub fn new_from( update: &StoreUpdate, storage: Arc<RwLock<dyn BlockStorage + Send + Sync>>, ) -> Store
pub fn id(&self) -> &PubKey
pub fn set_read_caps( &mut self, read_cap: ReadCap, overlay_read_cap: Option<ReadCap>, )
pub fn is_private(&self) -> bool
pub fn get_store_repo(&self) -> &StoreRepo
pub fn get_store_readcap(&self) -> &ReadCap
pub fn get_store_overlay_branch_readcap_secret(&self) -> &ReadCapSecret
pub fn get_store_overlay_branch_readcap(&self) -> &ReadCap
pub fn get_store_readcap_secret(&self) -> &ReadCapSecret
Sourcepub async fn fetch(&self, _id: &BlockId) -> Result<Block, StorageError>
pub async fn fetch(&self, _id: &BlockId) -> Result<Block, StorageError>
fetch a block from broker or core overlay
Sourcepub fn del(&self, id: &BlockId) -> Result<usize, StorageError>
pub fn del(&self, id: &BlockId) -> Result<usize, StorageError>
Delete a block from the storage.
Sourcepub fn len(&self) -> Result<usize, StorageError>
pub fn len(&self) -> Result<usize, StorageError>
number of Blocks in the storage
pub fn has(&self, id: &BlockId) -> Result<(), StorageError>
pub fn create_repo_default( self: Arc<Self>, creator: &UserId, creator_priv_key: &PrivKey, repo_write_cap_secret: SymKey, branch_crdt: BranchCrdt, ) -> Result<(Repo, Vec<(Commit, Vec<Digest>)>), NgError>
pub fn create_repo_with_keys( self: Arc<Self>, creator: &UserId, creator_priv_key: &PrivKey, repo_priv_key: PrivKey, repo_pub_key: PubKey, repo_write_cap_secret: SymKey, branch_crdt: Option<BranchCrdt>, is_private_store: bool, ) -> Result<(Repo, Vec<(Commit, Vec<Digest>)>), NgError>
pub fn new( store_repo: StoreRepo, store_readcap: ReadCap, store_overlay_branch_readcap: ReadCap, storage: Arc<RwLock<dyn BlockStorage + Send + Sync>>, ) -> Self
pub fn inner_overlay(&self) -> OverlayId
pub fn overlay_for_read_on_client_protocol(&self) -> OverlayId
pub fn outer_overlay(&self) -> OverlayId
Trait Implementations§
Source§impl From<&Store> for StoreUpdate
impl From<&Store> for StoreUpdate
Source§fn from(s: &Store) -> StoreUpdate
fn from(s: &Store) -> StoreUpdate
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for Store
impl RefUnwindSafe for Store
impl Send for Store
impl Sync for Store
impl Unpin for Store
impl UnwindSafe for Store
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