Skip to main content

heddle_client/grpc_hosted/
hydration.rs

1use objects::object::ChangeId;
2use proto::ProtocolError;
3use repo::Repository;
4
5use super::HostedGrpcClient;
6
7#[derive(Clone, Copy, Debug, Eq, PartialEq)]
8pub enum PullMaterialization {
9    Full,
10    Lazy,
11}
12
13impl PullMaterialization {
14    pub(crate) fn allows_partial_fetch(self) -> bool {
15        matches!(self, Self::Lazy)
16    }
17}
18
19impl HostedGrpcClient {
20    pub async fn hydrate_pulled_state(
21        &mut self,
22        repo: &Repository,
23        repo_path: &str,
24        remote_thread: &str,
25        target_state: ChangeId,
26    ) -> Result<usize, ProtocolError> {
27        self.hydrate_missing_blobs_for_state(repo, repo_path, remote_thread, target_state)
28            .await
29    }
30}