pub struct Repo {
pub id: RepoId,
pub repo_def: Repository,
pub read_cap: Option<ReadCap>,
pub write_cap: Option<RepoWriteCapSecret>,
pub signer: Option<SignerCap>,
pub certificate_ref: Option<ObjectRef>,
pub members: HashMap<Digest, UserInfo>,
pub branches: HashMap<BranchId, BranchInfo>,
pub opened_branches: HashMap<BranchId, bool>,
pub store: Arc<Store>,
}
Expand description
In memory Repository representation. With helper functions that access the underlying UserStorage and keeps proxy of the values
Fields§
§id: RepoId
§repo_def: Repository
Repo definition
read_cap: Option<ReadCap>
§write_cap: Option<RepoWriteCapSecret>
§signer: Option<SignerCap>
§certificate_ref: Option<ObjectRef>
§members: HashMap<Digest, UserInfo>
§branches: HashMap<BranchId, BranchInfo>
§opened_branches: HashMap<BranchId, bool>
if opened_branches is empty, it means the repo has not been opened yet. if a branchId is present in the hashmap, it means it is opened. the boolean indicates if the branch is opened as publisher or not
store: Arc<Store>
Implementations§
Source§impl Repo
impl Repo
pub fn history_at_heads( &self, heads: &[ObjectRef], ) -> Result<(Vec<(ObjectId, CommitInfo)>, Vec<Option<ObjectId>>), VerifierError>
pub fn update_branch_current_heads( &mut self, branch: &BranchId, commit_ref: ObjectRef, past: Vec<ObjectRef>, ) -> Result<Vec<ObjectRef>, VerifierError>
pub fn new_with_member( repo_id: &PubKey, member: &UserId, perms: &[PermissionV0], store: Arc<Store>, ) -> Self
pub fn verify_permission(&self, commit: &Commit) -> Result<(), NgError>
pub fn member_pubkey(&self, hash: &Digest) -> Result<UserId, NgError>
pub fn branch(&self, id: &BranchId) -> Result<&BranchInfo, NgError>
pub fn branch_mut(&mut self, id: &BranchId) -> Result<&mut BranchInfo, NgError>
pub fn overlay_branch(&self) -> Option<&BranchInfo>
pub fn user_branch(&self) -> Option<&BranchInfo>
pub fn main_branch(&self) -> Option<&BranchInfo>
pub fn store_branch(&self) -> Option<&BranchInfo>
pub fn header_branch(&self) -> Option<&BranchInfo>
pub fn root_branch(&self) -> Option<&BranchInfo>
pub fn overlay_branch_read_cap(&self) -> Option<&ReadCap>
pub fn branch_is_opened(&self, branch: &BranchId) -> bool
pub fn branch_is_opened_as_publisher(&self, branch: &BranchId) -> bool
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Repo
impl RefUnwindSafe for Repo
impl Send for Repo
impl Sync for Repo
impl Unpin for Repo
impl UnwindSafe for Repo
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