pub enum Branch {
V0(BranchV0),
}
Expand description
Branch definition
Variants§
Implementations§
Source§impl Branch
impl Branch
pub fn encrypt_branch_write_cap_secret( privkey: &BranchWriteCapSecret, topic_id: TopicId, branch_id: BranchId, repo_write_cap_secret: &RepoWriteCapSecret, ) -> Vec<u8> ⓘ
pub fn decrypt_branch_write_cap_secret( ciphertext: Vec<u8>, topic_id: TopicId, branch_id: BranchId, repo_write_cap_secret: &RepoWriteCapSecret, ) -> Result<BranchWriteCapSecret, NgError>
pub fn new( id: PubKey, repo: ObjectRef, root_branch_readcap_id: ObjectId, topic_priv: PrivKey, metadata: Vec<u8>, ) -> Branch
Sourcepub fn load_causal_past(
recursor: &mut Vec<(ObjectId, Option<ObjectId>)>,
store: &Store,
theirs: &HashSet<ObjectId>,
visited: &mut HashMap<ObjectId, DagNode>,
missing: &mut Option<&mut HashSet<ObjectId>>,
theirs_found: &mut Option<&mut HashSet<ObjectId>>,
theirs_filter: &Option<Filter>,
) -> Result<(), ObjectParseError>
pub fn load_causal_past( recursor: &mut Vec<(ObjectId, Option<ObjectId>)>, store: &Store, theirs: &HashSet<ObjectId>, visited: &mut HashMap<ObjectId, DagNode>, missing: &mut Option<&mut HashSet<ObjectId>>, theirs_found: &mut Option<&mut HashSet<ObjectId>>, theirs_filter: &Option<Filter>, ) -> Result<(), ObjectParseError>
Load causal past of a Commit cobj
in a Branch
from the Store
,
and collect in visited
the ObjectIds encountered on the way, stopping at any commit already belonging to theirs
or the root of DAG.
optionally collecting the missing objects/blocks that couldn’t be found locally on the way,
and also optionally, collecting the commits of theirs
found on the way
Sourcepub fn sync_req(
target_heads: impl Iterator<Item = ObjectId>,
known_heads: &[ObjectId],
known_commits: &Option<BloomFilter>,
store: &Store,
) -> Result<Vec<ObjectId>, ObjectParseError>
pub fn sync_req( target_heads: impl Iterator<Item = ObjectId>, known_heads: &[ObjectId], known_commits: &Option<BloomFilter>, store: &Store, ) -> Result<Vec<ObjectId>, ObjectParseError>
Branch sync request from another peer
target_heads
represents the list of heads the requester would like to reach. this list cannot be empty.
if the requester doesn’t know what to reach, the responder should fill this list with their own current local head.
this is not done here. it should be done before, in the handling of incoming requests.
known_heads
represents the list of current heads at the requester replica at the moment of request.
an empty list means the requester has an empty branch locally
Return ObjectIds to send, ordered in respect of causal partial order