You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: remote_cache.rs
    path of file: ./repos/pants/src/rust/engine/process_execution/remote/src
    
    the code of the file until where you have to start completion: // Copyright 2022 Pants project contributors (see CONTRIBUTORS.md).
// Licensed under the Apache License, Version 2.0 (see LICENSE).
use std::collections::{BTreeMap, HashSet};
use std::fmt::{self, Debug};
use std::sync::Arc;
use std::time::Instant;

use async_trait::async_trait;
use fs::{directory, DigestTrie, RelativePath, SymlinkBehavior};
use futures::future::{BoxFuture, TryFutureExt};
use futures::FutureExt;
use hashing::Digest;
use parking_lot::Mutex;
use protos::gen::build::bazel::remote::execution::v2 as remexec;
use protos::require_digest;
use remexec::{ActionResult, Command, Tree};
use remote_provider::{choose_action_cache_provider, ActionCacheProvider};

    
    fn log_cache_error(&self, err: String, err_type: CacheErrorType) {
        let err_count = {
            let mut errors_counter = match err_type {
                CacheErrorType::ReadError => self.read_errors_counter.lock(),
                CacheErrorType::WriteError => self.write_errors_counter.lock(),
            };
            let count = errors_counter.entry(err.clone()).or_insert(0);
            *count += 1;
            *count
        };
        let failure_desc = match err_type {
            CacheErrorType::ReadError => "read from",
            CacheErrorType::WriteError => "write to",
        };

        let log_at_warn = match self.warnings_behavior {
            RemoteCacheWarningsBehavior::Ignore => false,
            RemoteCacheWarningsBehavior::FirstOnly => err_count == 1,
            RemoteCacheWarningsBehavior::Backoff => err_count.is_power_of_two(),
            RemoteCacheWarningsBehavior::Always => true,
        };

        let level = if log_at_warn {
            Level::Warn
        } else {
            Level::Debug
        };

        log::log!(
            level,
            "Failed to {failure_desc} remote cache ({err_count} occurrences so far): {err}"
        );
    }