Struct Store

Source
pub struct Store {
    pub overlay_id: OverlayId,
    /* private fields */
}

Fields§

§overlay_id: OverlayId

Implementations§

Source§

impl Store

Source

pub fn new_temp_in_mem() -> Self

Source

pub fn new_from_overlay_id( overlay: &OverlayId, storage: Arc<RwLock<dyn BlockStorage + Send + Sync>>, ) -> Store

Source

pub fn new_from( update: &StoreUpdate, storage: Arc<RwLock<dyn BlockStorage + Send + Sync>>, ) -> Store

Source

pub fn id(&self) -> &PubKey

Source

pub fn set_read_caps( &mut self, read_cap: ReadCap, overlay_read_cap: Option<ReadCap>, )

Source

pub fn is_private(&self) -> bool

Source

pub fn get_store_repo(&self) -> &StoreRepo

Source

pub fn get_store_readcap(&self) -> &ReadCap

Source

pub fn get_store_overlay_branch_readcap_secret(&self) -> &ReadCapSecret

Source

pub fn get_store_overlay_branch_readcap(&self) -> &ReadCap

Source

pub fn get_store_readcap_secret(&self) -> &ReadCapSecret

Source

pub fn get(&self, id: &BlockId) -> Result<Block, StorageError>

Load a block from the storage.

Source

pub async fn fetch(&self, _id: &BlockId) -> Result<Block, StorageError>

fetch a block from broker or core overlay

Source

pub fn put(&self, block: &Block) -> Result<BlockId, StorageError>

Save a block to the storage.

Source

pub fn del(&self, id: &BlockId) -> Result<usize, StorageError>

Delete a block from the storage.

Source

pub fn len(&self) -> Result<usize, StorageError>

number of Blocks in the storage

Source

pub fn has(&self, id: &BlockId) -> Result<(), StorageError>

Source

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>

Source

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>

Source

pub fn new( store_repo: StoreRepo, store_readcap: ReadCap, store_overlay_branch_readcap: ReadCap, storage: Arc<RwLock<dyn BlockStorage + Send + Sync>>, ) -> Self

Source

pub fn inner_overlay(&self) -> OverlayId

Source

pub fn overlay_for_read_on_client_protocol(&self) -> OverlayId

Source

pub fn outer_overlay(&self) -> OverlayId

Trait Implementations§

Source§

impl Debug for Store

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl From<&Store> for StoreUpdate

Source§

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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V