#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Action {
#[prost(message, optional, tag = "1")]
pub command_digest: ::core::option::Option<Digest>,
#[prost(message, optional, tag = "2")]
pub input_root_digest: ::core::option::Option<Digest>,
#[prost(message, optional, tag = "6")]
pub timeout: ::core::option::Option<
super::super::super::super::super::google::protobuf::Duration,
>,
#[prost(bool, tag = "7")]
pub do_not_cache: bool,
#[prost(bytes = "vec", tag = "9")]
pub salt: ::prost::alloc::vec::Vec<u8>,
#[prost(message, optional, tag = "10")]
pub platform: ::core::option::Option<Platform>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Command {
#[prost(string, repeated, tag = "1")]
pub arguments: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
#[prost(message, repeated, tag = "2")]
pub environment_variables: ::prost::alloc::vec::Vec<command::EnvironmentVariable>,
#[deprecated]
#[prost(string, repeated, tag = "3")]
pub output_files: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
#[deprecated]
#[prost(string, repeated, tag = "4")]
pub output_directories: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
#[prost(string, repeated, tag = "7")]
pub output_paths: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
#[deprecated]
#[prost(message, optional, tag = "5")]
pub platform: ::core::option::Option<Platform>,
#[prost(string, tag = "6")]
pub working_directory: ::prost::alloc::string::String,
#[prost(string, repeated, tag = "8")]
pub output_node_properties: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
#[prost(enumeration = "command::OutputDirectoryFormat", tag = "9")]
pub output_directory_format: i32,
}
pub mod command {
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct EnvironmentVariable {
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub value: ::prost::alloc::string::String,
}
#[derive(
Clone,
Copy,
Debug,
PartialEq,
Eq,
Hash,
PartialOrd,
Ord,
::prost::Enumeration
)]
#[repr(i32)]
pub enum OutputDirectoryFormat {
TreeOnly = 0,
DirectoryOnly = 1,
TreeAndDirectory = 2,
}
impl OutputDirectoryFormat {
pub fn as_str_name(&self) -> &'static str {
match self {
Self::TreeOnly => "TREE_ONLY",
Self::DirectoryOnly => "DIRECTORY_ONLY",
Self::TreeAndDirectory => "TREE_AND_DIRECTORY",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"TREE_ONLY" => Some(Self::TreeOnly),
"DIRECTORY_ONLY" => Some(Self::DirectoryOnly),
"TREE_AND_DIRECTORY" => Some(Self::TreeAndDirectory),
_ => None,
}
}
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Platform {
#[prost(message, repeated, tag = "1")]
pub properties: ::prost::alloc::vec::Vec<platform::Property>,
}
pub mod platform {
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct Property {
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub value: ::prost::alloc::string::String,
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Directory {
#[prost(message, repeated, tag = "1")]
pub files: ::prost::alloc::vec::Vec<FileNode>,
#[prost(message, repeated, tag = "2")]
pub directories: ::prost::alloc::vec::Vec<DirectoryNode>,
#[prost(message, repeated, tag = "3")]
pub symlinks: ::prost::alloc::vec::Vec<SymlinkNode>,
#[prost(message, optional, tag = "5")]
pub node_properties: ::core::option::Option<NodeProperties>,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct NodeProperty {
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub value: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct NodeProperties {
#[prost(message, repeated, tag = "1")]
pub properties: ::prost::alloc::vec::Vec<NodeProperty>,
#[prost(message, optional, tag = "2")]
pub mtime: ::core::option::Option<
super::super::super::super::super::google::protobuf::Timestamp,
>,
#[prost(message, optional, tag = "3")]
pub unix_mode: ::core::option::Option<
super::super::super::super::super::google::protobuf::UInt32Value,
>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct FileNode {
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
#[prost(message, optional, tag = "2")]
pub digest: ::core::option::Option<Digest>,
#[prost(bool, tag = "4")]
pub is_executable: bool,
#[prost(message, optional, tag = "6")]
pub node_properties: ::core::option::Option<NodeProperties>,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct DirectoryNode {
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
#[prost(message, optional, tag = "2")]
pub digest: ::core::option::Option<Digest>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SymlinkNode {
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub target: ::prost::alloc::string::String,
#[prost(message, optional, tag = "4")]
pub node_properties: ::core::option::Option<NodeProperties>,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct Digest {
#[prost(string, tag = "1")]
pub hash: ::prost::alloc::string::String,
#[prost(int64, tag = "2")]
pub size_bytes: i64,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ExecutedActionMetadata {
#[prost(string, tag = "1")]
pub worker: ::prost::alloc::string::String,
#[prost(message, optional, tag = "2")]
pub queued_timestamp: ::core::option::Option<
super::super::super::super::super::google::protobuf::Timestamp,
>,
#[prost(message, optional, tag = "3")]
pub worker_start_timestamp: ::core::option::Option<
super::super::super::super::super::google::protobuf::Timestamp,
>,
#[prost(message, optional, tag = "4")]
pub worker_completed_timestamp: ::core::option::Option<
super::super::super::super::super::google::protobuf::Timestamp,
>,
#[prost(message, optional, tag = "5")]
pub input_fetch_start_timestamp: ::core::option::Option<
super::super::super::super::super::google::protobuf::Timestamp,
>,
#[prost(message, optional, tag = "6")]
pub input_fetch_completed_timestamp: ::core::option::Option<
super::super::super::super::super::google::protobuf::Timestamp,
>,
#[prost(message, optional, tag = "7")]
pub execution_start_timestamp: ::core::option::Option<
super::super::super::super::super::google::protobuf::Timestamp,
>,
#[prost(message, optional, tag = "8")]
pub execution_completed_timestamp: ::core::option::Option<
super::super::super::super::super::google::protobuf::Timestamp,
>,
#[prost(message, optional, tag = "12")]
pub virtual_execution_duration: ::core::option::Option<
super::super::super::super::super::google::protobuf::Duration,
>,
#[prost(message, optional, tag = "9")]
pub output_upload_start_timestamp: ::core::option::Option<
super::super::super::super::super::google::protobuf::Timestamp,
>,
#[prost(message, optional, tag = "10")]
pub output_upload_completed_timestamp: ::core::option::Option<
super::super::super::super::super::google::protobuf::Timestamp,
>,
#[prost(message, repeated, tag = "11")]
pub auxiliary_metadata: ::prost::alloc::vec::Vec<
super::super::super::super::super::google::protobuf::Any,
>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ActionResult {
#[prost(message, repeated, tag = "2")]
pub output_files: ::prost::alloc::vec::Vec<OutputFile>,
#[deprecated]
#[prost(message, repeated, tag = "10")]
pub output_file_symlinks: ::prost::alloc::vec::Vec<OutputSymlink>,
#[prost(message, repeated, tag = "12")]
pub output_symlinks: ::prost::alloc::vec::Vec<OutputSymlink>,
#[prost(message, repeated, tag = "3")]
pub output_directories: ::prost::alloc::vec::Vec<OutputDirectory>,
#[deprecated]
#[prost(message, repeated, tag = "11")]
pub output_directory_symlinks: ::prost::alloc::vec::Vec<OutputSymlink>,
#[prost(int32, tag = "4")]
pub exit_code: i32,
#[prost(bytes = "vec", tag = "5")]
pub stdout_raw: ::prost::alloc::vec::Vec<u8>,
#[prost(message, optional, tag = "6")]
pub stdout_digest: ::core::option::Option<Digest>,
#[prost(bytes = "vec", tag = "7")]
pub stderr_raw: ::prost::alloc::vec::Vec<u8>,
#[prost(message, optional, tag = "8")]
pub stderr_digest: ::core::option::Option<Digest>,
#[prost(message, optional, tag = "9")]
pub execution_metadata: ::core::option::Option<ExecutedActionMetadata>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct OutputFile {
#[prost(string, tag = "1")]
pub path: ::prost::alloc::string::String,
#[prost(message, optional, tag = "2")]
pub digest: ::core::option::Option<Digest>,
#[prost(bool, tag = "4")]
pub is_executable: bool,
#[prost(bytes = "vec", tag = "5")]
pub contents: ::prost::alloc::vec::Vec<u8>,
#[prost(message, optional, tag = "7")]
pub node_properties: ::core::option::Option<NodeProperties>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Tree {
#[prost(message, optional, tag = "1")]
pub root: ::core::option::Option<Directory>,
#[prost(message, repeated, tag = "2")]
pub children: ::prost::alloc::vec::Vec<Directory>,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct OutputDirectory {
#[prost(string, tag = "1")]
pub path: ::prost::alloc::string::String,
#[prost(message, optional, tag = "3")]
pub tree_digest: ::core::option::Option<Digest>,
#[prost(bool, tag = "4")]
pub is_topologically_sorted: bool,
#[prost(message, optional, tag = "5")]
pub root_directory_digest: ::core::option::Option<Digest>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct OutputSymlink {
#[prost(string, tag = "1")]
pub path: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub target: ::prost::alloc::string::String,
#[prost(message, optional, tag = "4")]
pub node_properties: ::core::option::Option<NodeProperties>,
}
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct ExecutionPolicy {
#[prost(int32, tag = "1")]
pub priority: i32,
}
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct ResultsCachePolicy {
#[prost(int32, tag = "1")]
pub priority: i32,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct ExecuteRequest {
#[prost(string, tag = "1")]
pub instance_name: ::prost::alloc::string::String,
#[prost(bool, tag = "3")]
pub skip_cache_lookup: bool,
#[prost(message, optional, tag = "6")]
pub action_digest: ::core::option::Option<Digest>,
#[prost(message, optional, tag = "7")]
pub execution_policy: ::core::option::Option<ExecutionPolicy>,
#[prost(message, optional, tag = "8")]
pub results_cache_policy: ::core::option::Option<ResultsCachePolicy>,
#[prost(enumeration = "digest_function::Value", tag = "9")]
pub digest_function: i32,
#[prost(bool, tag = "10")]
pub inline_stdout: bool,
#[prost(bool, tag = "11")]
pub inline_stderr: bool,
#[prost(string, repeated, tag = "12")]
pub inline_output_files: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct LogFile {
#[prost(message, optional, tag = "1")]
pub digest: ::core::option::Option<Digest>,
#[prost(bool, tag = "2")]
pub human_readable: bool,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ExecuteResponse {
#[prost(message, optional, tag = "1")]
pub result: ::core::option::Option<ActionResult>,
#[prost(bool, tag = "2")]
pub cached_result: bool,
#[prost(message, optional, tag = "3")]
pub status: ::core::option::Option<
super::super::super::super::super::google::rpc::Status,
>,
#[prost(map = "string, message", tag = "4")]
pub server_logs: ::std::collections::HashMap<
::prost::alloc::string::String,
LogFile,
>,
#[prost(string, tag = "5")]
pub message: ::prost::alloc::string::String,
}
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct ExecutionStage {}
pub mod execution_stage {
#[derive(
Clone,
Copy,
Debug,
PartialEq,
Eq,
Hash,
PartialOrd,
Ord,
::prost::Enumeration
)]
#[repr(i32)]
pub enum Value {
Unknown = 0,
CacheCheck = 1,
Queued = 2,
Executing = 3,
Completed = 4,
}
impl Value {
pub fn as_str_name(&self) -> &'static str {
match self {
Self::Unknown => "UNKNOWN",
Self::CacheCheck => "CACHE_CHECK",
Self::Queued => "QUEUED",
Self::Executing => "EXECUTING",
Self::Completed => "COMPLETED",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"UNKNOWN" => Some(Self::Unknown),
"CACHE_CHECK" => Some(Self::CacheCheck),
"QUEUED" => Some(Self::Queued),
"EXECUTING" => Some(Self::Executing),
"COMPLETED" => Some(Self::Completed),
_ => None,
}
}
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ExecuteOperationMetadata {
#[prost(enumeration = "execution_stage::Value", tag = "1")]
pub stage: i32,
#[prost(message, optional, tag = "2")]
pub action_digest: ::core::option::Option<Digest>,
#[prost(string, tag = "3")]
pub stdout_stream_name: ::prost::alloc::string::String,
#[prost(string, tag = "4")]
pub stderr_stream_name: ::prost::alloc::string::String,
#[prost(message, optional, tag = "5")]
pub partial_execution_metadata: ::core::option::Option<ExecutedActionMetadata>,
#[prost(enumeration = "digest_function::Value", tag = "6")]
pub digest_function: i32,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct WaitExecutionRequest {
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct GetActionResultRequest {
#[prost(string, tag = "1")]
pub instance_name: ::prost::alloc::string::String,
#[prost(message, optional, tag = "2")]
pub action_digest: ::core::option::Option<Digest>,
#[prost(bool, tag = "3")]
pub inline_stdout: bool,
#[prost(bool, tag = "4")]
pub inline_stderr: bool,
#[prost(string, repeated, tag = "5")]
pub inline_output_files: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
#[prost(enumeration = "digest_function::Value", tag = "6")]
pub digest_function: i32,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct UpdateActionResultRequest {
#[prost(string, tag = "1")]
pub instance_name: ::prost::alloc::string::String,
#[prost(message, optional, tag = "2")]
pub action_digest: ::core::option::Option<Digest>,
#[prost(message, optional, tag = "3")]
pub action_result: ::core::option::Option<ActionResult>,
#[prost(message, optional, tag = "4")]
pub results_cache_policy: ::core::option::Option<ResultsCachePolicy>,
#[prost(enumeration = "digest_function::Value", tag = "5")]
pub digest_function: i32,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct FindMissingBlobsRequest {
#[prost(string, tag = "1")]
pub instance_name: ::prost::alloc::string::String,
#[prost(message, repeated, tag = "2")]
pub blob_digests: ::prost::alloc::vec::Vec<Digest>,
#[prost(enumeration = "digest_function::Value", tag = "3")]
pub digest_function: i32,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct FindMissingBlobsResponse {
#[prost(message, repeated, tag = "2")]
pub missing_blob_digests: ::prost::alloc::vec::Vec<Digest>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct BatchUpdateBlobsRequest {
#[prost(string, tag = "1")]
pub instance_name: ::prost::alloc::string::String,
#[prost(message, repeated, tag = "2")]
pub requests: ::prost::alloc::vec::Vec<batch_update_blobs_request::Request>,
#[prost(enumeration = "digest_function::Value", tag = "5")]
pub digest_function: i32,
}
pub mod batch_update_blobs_request {
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct Request {
#[prost(message, optional, tag = "1")]
pub digest: ::core::option::Option<super::Digest>,
#[prost(bytes = "vec", tag = "2")]
pub data: ::prost::alloc::vec::Vec<u8>,
#[prost(enumeration = "super::compressor::Value", tag = "3")]
pub compressor: i32,
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct BatchUpdateBlobsResponse {
#[prost(message, repeated, tag = "1")]
pub responses: ::prost::alloc::vec::Vec<batch_update_blobs_response::Response>,
}
pub mod batch_update_blobs_response {
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Response {
#[prost(message, optional, tag = "1")]
pub digest: ::core::option::Option<super::Digest>,
#[prost(message, optional, tag = "2")]
pub status: ::core::option::Option<
super::super::super::super::super::super::google::rpc::Status,
>,
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct BatchReadBlobsRequest {
#[prost(string, tag = "1")]
pub instance_name: ::prost::alloc::string::String,
#[prost(message, repeated, tag = "2")]
pub digests: ::prost::alloc::vec::Vec<Digest>,
#[prost(enumeration = "compressor::Value", repeated, tag = "3")]
pub acceptable_compressors: ::prost::alloc::vec::Vec<i32>,
#[prost(enumeration = "digest_function::Value", tag = "4")]
pub digest_function: i32,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct BatchReadBlobsResponse {
#[prost(message, repeated, tag = "1")]
pub responses: ::prost::alloc::vec::Vec<batch_read_blobs_response::Response>,
}
pub mod batch_read_blobs_response {
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Response {
#[prost(message, optional, tag = "1")]
pub digest: ::core::option::Option<super::Digest>,
#[prost(bytes = "vec", tag = "2")]
pub data: ::prost::alloc::vec::Vec<u8>,
#[prost(enumeration = "super::compressor::Value", tag = "4")]
pub compressor: i32,
#[prost(message, optional, tag = "3")]
pub status: ::core::option::Option<
super::super::super::super::super::super::google::rpc::Status,
>,
}
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct GetTreeRequest {
#[prost(string, tag = "1")]
pub instance_name: ::prost::alloc::string::String,
#[prost(message, optional, tag = "2")]
pub root_digest: ::core::option::Option<Digest>,
#[prost(int32, tag = "3")]
pub page_size: i32,
#[prost(string, tag = "4")]
pub page_token: ::prost::alloc::string::String,
#[prost(enumeration = "digest_function::Value", tag = "5")]
pub digest_function: i32,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetTreeResponse {
#[prost(message, repeated, tag = "1")]
pub directories: ::prost::alloc::vec::Vec<Directory>,
#[prost(string, tag = "2")]
pub next_page_token: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct SplitBlobRequest {
#[prost(string, tag = "1")]
pub instance_name: ::prost::alloc::string::String,
#[prost(message, optional, tag = "2")]
pub blob_digest: ::core::option::Option<Digest>,
#[prost(enumeration = "digest_function::Value", tag = "3")]
pub digest_function: i32,
#[prost(enumeration = "chunking_function::Value", tag = "4")]
pub chunking_function: i32,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SplitBlobResponse {
#[prost(message, repeated, tag = "1")]
pub chunk_digests: ::prost::alloc::vec::Vec<Digest>,
#[prost(enumeration = "chunking_function::Value", tag = "2")]
pub chunking_function: i32,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetChunkMappingResponse {
#[prost(message, repeated, tag = "1")]
pub chunk_digests: ::prost::alloc::vec::Vec<Digest>,
#[prost(enumeration = "chunking_function::Value", tag = "2")]
pub chunking_function: i32,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SpliceBlobRequest {
#[prost(string, tag = "1")]
pub instance_name: ::prost::alloc::string::String,
#[prost(message, optional, tag = "2")]
pub blob_digest: ::core::option::Option<Digest>,
#[prost(message, repeated, tag = "3")]
pub chunk_digests: ::prost::alloc::vec::Vec<Digest>,
#[prost(enumeration = "digest_function::Value", tag = "4")]
pub digest_function: i32,
#[prost(enumeration = "chunking_function::Value", tag = "5")]
pub chunking_function: i32,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct RegisterChunkMappingRequest {
#[prost(string, tag = "1")]
pub instance_name: ::prost::alloc::string::String,
#[prost(message, optional, tag = "2")]
pub blob_digest: ::core::option::Option<Digest>,
#[prost(message, repeated, tag = "3")]
pub chunk_digests: ::prost::alloc::vec::Vec<Digest>,
#[prost(enumeration = "digest_function::Value", tag = "4")]
pub digest_function: i32,
#[prost(enumeration = "chunking_function::Value", tag = "5")]
pub chunking_function: i32,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct SpliceBlobResponse {
#[prost(message, optional, tag = "1")]
pub blob_digest: ::core::option::Option<Digest>,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct GetCapabilitiesRequest {
#[prost(string, tag = "1")]
pub instance_name: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ServerCapabilities {
#[prost(message, optional, tag = "1")]
pub cache_capabilities: ::core::option::Option<CacheCapabilities>,
#[prost(message, optional, tag = "2")]
pub execution_capabilities: ::core::option::Option<ExecutionCapabilities>,
#[prost(message, optional, tag = "3")]
pub deprecated_api_version: ::core::option::Option<
super::super::super::semver::SemVer,
>,
#[prost(message, optional, tag = "4")]
pub low_api_version: ::core::option::Option<super::super::super::semver::SemVer>,
#[prost(message, optional, tag = "5")]
pub high_api_version: ::core::option::Option<super::super::super::semver::SemVer>,
}
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct DigestFunction {}
pub mod digest_function {
#[derive(
Clone,
Copy,
Debug,
PartialEq,
Eq,
Hash,
PartialOrd,
Ord,
::prost::Enumeration
)]
#[repr(i32)]
pub enum Value {
Unknown = 0,
Sha256 = 1,
Sha1 = 2,
Md5 = 3,
Vso = 4,
Sha384 = 5,
Sha512 = 6,
Murmur3 = 7,
Sha256tree = 8,
Blake3 = 9,
Gitsha1 = 10,
}
impl Value {
pub fn as_str_name(&self) -> &'static str {
match self {
Self::Unknown => "UNKNOWN",
Self::Sha256 => "SHA256",
Self::Sha1 => "SHA1",
Self::Md5 => "MD5",
Self::Vso => "VSO",
Self::Sha384 => "SHA384",
Self::Sha512 => "SHA512",
Self::Murmur3 => "MURMUR3",
Self::Sha256tree => "SHA256TREE",
Self::Blake3 => "BLAKE3",
Self::Gitsha1 => "GITSHA1",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"UNKNOWN" => Some(Self::Unknown),
"SHA256" => Some(Self::Sha256),
"SHA1" => Some(Self::Sha1),
"MD5" => Some(Self::Md5),
"VSO" => Some(Self::Vso),
"SHA384" => Some(Self::Sha384),
"SHA512" => Some(Self::Sha512),
"MURMUR3" => Some(Self::Murmur3),
"SHA256TREE" => Some(Self::Sha256tree),
"BLAKE3" => Some(Self::Blake3),
"GITSHA1" => Some(Self::Gitsha1),
_ => None,
}
}
}
}
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct ChunkingFunction {}
pub mod chunking_function {
#[derive(
Clone,
Copy,
Debug,
PartialEq,
Eq,
Hash,
PartialOrd,
Ord,
::prost::Enumeration
)]
#[repr(i32)]
pub enum Value {
Unknown = 0,
FastCdc2020 = 1,
RepMaxCdc = 2,
}
impl Value {
pub fn as_str_name(&self) -> &'static str {
match self {
Self::Unknown => "UNKNOWN",
Self::FastCdc2020 => "FAST_CDC_2020",
Self::RepMaxCdc => "REP_MAX_CDC",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"UNKNOWN" => Some(Self::Unknown),
"FAST_CDC_2020" => Some(Self::FastCdc2020),
"REP_MAX_CDC" => Some(Self::RepMaxCdc),
_ => None,
}
}
}
}
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct ActionCacheUpdateCapabilities {
#[prost(bool, tag = "1")]
pub update_enabled: bool,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct PriorityCapabilities {
#[prost(message, repeated, tag = "1")]
pub priorities: ::prost::alloc::vec::Vec<priority_capabilities::PriorityRange>,
}
pub mod priority_capabilities {
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct PriorityRange {
#[prost(int32, tag = "1")]
pub min_priority: i32,
#[prost(int32, tag = "2")]
pub max_priority: i32,
}
}
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct SymlinkAbsolutePathStrategy {}
pub mod symlink_absolute_path_strategy {
#[derive(
Clone,
Copy,
Debug,
PartialEq,
Eq,
Hash,
PartialOrd,
Ord,
::prost::Enumeration
)]
#[repr(i32)]
pub enum Value {
Unknown = 0,
Disallowed = 1,
Allowed = 2,
}
impl Value {
pub fn as_str_name(&self) -> &'static str {
match self {
Self::Unknown => "UNKNOWN",
Self::Disallowed => "DISALLOWED",
Self::Allowed => "ALLOWED",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"UNKNOWN" => Some(Self::Unknown),
"DISALLOWED" => Some(Self::Disallowed),
"ALLOWED" => Some(Self::Allowed),
_ => None,
}
}
}
}
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct Compressor {}
pub mod compressor {
#[derive(
Clone,
Copy,
Debug,
PartialEq,
Eq,
Hash,
PartialOrd,
Ord,
::prost::Enumeration
)]
#[repr(i32)]
pub enum Value {
Identity = 0,
Zstd = 1,
Deflate = 2,
Brotli = 3,
}
impl Value {
pub fn as_str_name(&self) -> &'static str {
match self {
Self::Identity => "IDENTITY",
Self::Zstd => "ZSTD",
Self::Deflate => "DEFLATE",
Self::Brotli => "BROTLI",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"IDENTITY" => Some(Self::Identity),
"ZSTD" => Some(Self::Zstd),
"DEFLATE" => Some(Self::Deflate),
"BROTLI" => Some(Self::Brotli),
_ => None,
}
}
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CacheCapabilities {
#[prost(enumeration = "digest_function::Value", repeated, tag = "1")]
pub digest_functions: ::prost::alloc::vec::Vec<i32>,
#[prost(message, optional, tag = "2")]
pub action_cache_update_capabilities: ::core::option::Option<
ActionCacheUpdateCapabilities,
>,
#[prost(message, optional, tag = "3")]
pub cache_priority_capabilities: ::core::option::Option<PriorityCapabilities>,
#[prost(int64, tag = "4")]
pub max_batch_total_size_bytes: i64,
#[prost(enumeration = "symlink_absolute_path_strategy::Value", tag = "5")]
pub symlink_absolute_path_strategy: i32,
#[prost(enumeration = "compressor::Value", repeated, tag = "6")]
pub supported_compressors: ::prost::alloc::vec::Vec<i32>,
#[prost(enumeration = "compressor::Value", repeated, tag = "7")]
pub supported_batch_update_compressors: ::prost::alloc::vec::Vec<i32>,
#[prost(int64, tag = "8")]
pub max_cas_blob_size_bytes: i64,
#[prost(bool, tag = "9")]
pub split_blob_support: bool,
#[prost(bool, tag = "10")]
pub splice_blob_support: bool,
#[prost(message, optional, tag = "11")]
pub fast_cdc_2020_params: ::core::option::Option<FastCdc2020Params>,
#[prost(message, optional, tag = "12")]
pub rep_max_cdc_params: ::core::option::Option<RepMaxCdcParams>,
}
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct FastCdc2020Params {
#[prost(uint64, tag = "1")]
pub avg_chunk_size_bytes: u64,
#[prost(uint32, tag = "2")]
pub seed: u32,
}
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct RepMaxCdcParams {
#[prost(uint64, tag = "1")]
pub min_chunk_size_bytes: u64,
#[prost(uint64, tag = "2")]
pub horizon_size_bytes: u64,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ExecutionCapabilities {
#[prost(enumeration = "digest_function::Value", tag = "1")]
pub digest_function: i32,
#[prost(bool, tag = "2")]
pub exec_enabled: bool,
#[prost(message, optional, tag = "3")]
pub execution_priority_capabilities: ::core::option::Option<PriorityCapabilities>,
#[prost(string, repeated, tag = "4")]
pub supported_node_properties: ::prost::alloc::vec::Vec<
::prost::alloc::string::String,
>,
#[prost(enumeration = "digest_function::Value", repeated, tag = "5")]
pub digest_functions: ::prost::alloc::vec::Vec<i32>,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct ToolDetails {
#[prost(string, tag = "1")]
pub tool_name: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub tool_version: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct RequestMetadata {
#[prost(message, optional, tag = "1")]
pub tool_details: ::core::option::Option<ToolDetails>,
#[prost(string, tag = "2")]
pub action_id: ::prost::alloc::string::String,
#[prost(string, tag = "3")]
pub tool_invocation_id: ::prost::alloc::string::String,
#[prost(string, tag = "4")]
pub correlated_invocations_id: ::prost::alloc::string::String,
#[prost(string, tag = "5")]
pub action_mnemonic: ::prost::alloc::string::String,
#[prost(string, tag = "6")]
pub target_id: ::prost::alloc::string::String,
#[prost(string, tag = "7")]
pub configuration_id: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct GetChunkMappingRequest {
#[prost(string, tag = "1")]
pub instance_name: ::prost::alloc::string::String,
#[prost(message, optional, tag = "2")]
pub blob_digest: ::core::option::Option<Digest>,
#[prost(enumeration = "digest_function::Value", tag = "3")]
pub digest_function: i32,
#[prost(enumeration = "chunking_function::Value", tag = "4")]
pub chunking_function: i32,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct RegisterChunkMappingResponse {
#[prost(message, optional, tag = "1")]
pub blob_digest: ::core::option::Option<Digest>,
}
pub mod execution_client {
#![allow(
unused_variables,
dead_code,
missing_docs,
clippy::wildcard_imports,
clippy::let_unit_value,
)]
use tonic::codegen::*;
use tonic::codegen::http::Uri;
#[derive(Debug, Clone)]
pub struct ExecutionClient<T> {
inner: tonic::client::Grpc<T>,
}
impl ExecutionClient<tonic::transport::Channel> {
pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
where
D: TryInto<tonic::transport::Endpoint>,
D::Error: Into<StdError>,
{
let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
Ok(Self::new(conn))
}
}
impl<T> ExecutionClient<T>
where
T: tonic::client::GrpcService<tonic::body::Body>,
T::Error: Into<StdError>,
T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
<T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
{
pub fn new(inner: T) -> Self {
let inner = tonic::client::Grpc::new(inner);
Self { inner }
}
pub fn with_origin(inner: T, origin: Uri) -> Self {
let inner = tonic::client::Grpc::with_origin(inner, origin);
Self { inner }
}
pub fn with_interceptor<F>(
inner: T,
interceptor: F,
) -> ExecutionClient<InterceptedService<T, F>>
where
F: tonic::service::Interceptor,
T::ResponseBody: Default,
T: tonic::codegen::Service<
http::Request<tonic::body::Body>,
Response = http::Response<
<T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
>,
>,
<T as tonic::codegen::Service<
http::Request<tonic::body::Body>,
>>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
{
ExecutionClient::new(InterceptedService::new(inner, interceptor))
}
#[must_use]
pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.inner = self.inner.send_compressed(encoding);
self
}
#[must_use]
pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.inner = self.inner.accept_compressed(encoding);
self
}
#[must_use]
pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
self.inner = self.inner.max_decoding_message_size(limit);
self
}
#[must_use]
pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
self.inner = self.inner.max_encoding_message_size(limit);
self
}
pub async fn execute(
&mut self,
request: impl tonic::IntoRequest<super::ExecuteRequest>,
) -> std::result::Result<
tonic::Response<
tonic::codec::Streaming<
super::super::super::super::super::super::google::longrunning::Operation,
>,
>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic_prost::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/build.bazel.remote.execution.v2.Execution/Execute",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"build.bazel.remote.execution.v2.Execution",
"Execute",
),
);
self.inner.server_streaming(req, path, codec).await
}
pub async fn wait_execution(
&mut self,
request: impl tonic::IntoRequest<super::WaitExecutionRequest>,
) -> std::result::Result<
tonic::Response<
tonic::codec::Streaming<
super::super::super::super::super::super::google::longrunning::Operation,
>,
>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic_prost::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/build.bazel.remote.execution.v2.Execution/WaitExecution",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"build.bazel.remote.execution.v2.Execution",
"WaitExecution",
),
);
self.inner.server_streaming(req, path, codec).await
}
}
}
pub mod execution_server {
#![allow(
unused_variables,
dead_code,
missing_docs,
clippy::wildcard_imports,
clippy::let_unit_value,
)]
use tonic::codegen::*;
#[async_trait]
pub trait Execution: std::marker::Send + std::marker::Sync + 'static {
type ExecuteStream: tonic::codegen::tokio_stream::Stream<
Item = std::result::Result<
super::super::super::super::super::super::google::longrunning::Operation,
tonic::Status,
>,
>
+ std::marker::Send
+ 'static;
async fn execute(
&self,
request: tonic::Request<super::ExecuteRequest>,
) -> std::result::Result<tonic::Response<Self::ExecuteStream>, tonic::Status>;
type WaitExecutionStream: tonic::codegen::tokio_stream::Stream<
Item = std::result::Result<
super::super::super::super::super::super::google::longrunning::Operation,
tonic::Status,
>,
>
+ std::marker::Send
+ 'static;
async fn wait_execution(
&self,
request: tonic::Request<super::WaitExecutionRequest>,
) -> std::result::Result<
tonic::Response<Self::WaitExecutionStream>,
tonic::Status,
>;
}
#[derive(Debug)]
pub struct ExecutionServer<T> {
inner: Arc<T>,
accept_compression_encodings: EnabledCompressionEncodings,
send_compression_encodings: EnabledCompressionEncodings,
max_decoding_message_size: Option<usize>,
max_encoding_message_size: Option<usize>,
}
impl<T> ExecutionServer<T> {
pub fn new(inner: T) -> Self {
Self::from_arc(Arc::new(inner))
}
pub fn from_arc(inner: Arc<T>) -> Self {
Self {
inner,
accept_compression_encodings: Default::default(),
send_compression_encodings: Default::default(),
max_decoding_message_size: None,
max_encoding_message_size: None,
}
}
pub fn with_interceptor<F>(
inner: T,
interceptor: F,
) -> InterceptedService<Self, F>
where
F: tonic::service::Interceptor,
{
InterceptedService::new(Self::new(inner), interceptor)
}
#[must_use]
pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.accept_compression_encodings.enable(encoding);
self
}
#[must_use]
pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.send_compression_encodings.enable(encoding);
self
}
#[must_use]
pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
self.max_decoding_message_size = Some(limit);
self
}
#[must_use]
pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
self.max_encoding_message_size = Some(limit);
self
}
}
impl<T, B> tonic::codegen::Service<http::Request<B>> for ExecutionServer<T>
where
T: Execution,
B: Body + std::marker::Send + 'static,
B::Error: Into<StdError> + std::marker::Send + 'static,
{
type Response = http::Response<tonic::body::Body>;
type Error = std::convert::Infallible;
type Future = BoxFuture<Self::Response, Self::Error>;
fn poll_ready(
&mut self,
_cx: &mut Context<'_>,
) -> Poll<std::result::Result<(), Self::Error>> {
Poll::Ready(Ok(()))
}
fn call(&mut self, req: http::Request<B>) -> Self::Future {
match req.uri().path() {
"/build.bazel.remote.execution.v2.Execution/Execute" => {
#[allow(non_camel_case_types)]
struct ExecuteSvc<T: Execution>(pub Arc<T>);
impl<
T: Execution,
> tonic::server::ServerStreamingService<super::ExecuteRequest>
for ExecuteSvc<T> {
type Response = super::super::super::super::super::super::google::longrunning::Operation;
type ResponseStream = T::ExecuteStream;
type Future = BoxFuture<
tonic::Response<Self::ResponseStream>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::ExecuteRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as Execution>::execute(&inner, request).await
};
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let max_decoding_message_size = self.max_decoding_message_size;
let max_encoding_message_size = self.max_encoding_message_size;
let inner = self.inner.clone();
let fut = async move {
let method = ExecuteSvc(inner);
let codec = tonic_prost::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
)
.apply_max_message_size_config(
max_decoding_message_size,
max_encoding_message_size,
);
let res = grpc.server_streaming(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/build.bazel.remote.execution.v2.Execution/WaitExecution" => {
#[allow(non_camel_case_types)]
struct WaitExecutionSvc<T: Execution>(pub Arc<T>);
impl<
T: Execution,
> tonic::server::ServerStreamingService<super::WaitExecutionRequest>
for WaitExecutionSvc<T> {
type Response = super::super::super::super::super::super::google::longrunning::Operation;
type ResponseStream = T::WaitExecutionStream;
type Future = BoxFuture<
tonic::Response<Self::ResponseStream>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::WaitExecutionRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as Execution>::wait_execution(&inner, request).await
};
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let max_decoding_message_size = self.max_decoding_message_size;
let max_encoding_message_size = self.max_encoding_message_size;
let inner = self.inner.clone();
let fut = async move {
let method = WaitExecutionSvc(inner);
let codec = tonic_prost::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
)
.apply_max_message_size_config(
max_decoding_message_size,
max_encoding_message_size,
);
let res = grpc.server_streaming(method, req).await;
Ok(res)
};
Box::pin(fut)
}
_ => {
Box::pin(async move {
let mut response = http::Response::new(
tonic::body::Body::default(),
);
let headers = response.headers_mut();
headers
.insert(
tonic::Status::GRPC_STATUS,
(tonic::Code::Unimplemented as i32).into(),
);
headers
.insert(
http::header::CONTENT_TYPE,
tonic::metadata::GRPC_CONTENT_TYPE,
);
Ok(response)
})
}
}
}
}
impl<T> Clone for ExecutionServer<T> {
fn clone(&self) -> Self {
let inner = self.inner.clone();
Self {
inner,
accept_compression_encodings: self.accept_compression_encodings,
send_compression_encodings: self.send_compression_encodings,
max_decoding_message_size: self.max_decoding_message_size,
max_encoding_message_size: self.max_encoding_message_size,
}
}
}
pub const SERVICE_NAME: &str = "build.bazel.remote.execution.v2.Execution";
impl<T> tonic::server::NamedService for ExecutionServer<T> {
const NAME: &'static str = SERVICE_NAME;
}
}
pub mod action_cache_client {
#![allow(
unused_variables,
dead_code,
missing_docs,
clippy::wildcard_imports,
clippy::let_unit_value,
)]
use tonic::codegen::*;
use tonic::codegen::http::Uri;
#[derive(Debug, Clone)]
pub struct ActionCacheClient<T> {
inner: tonic::client::Grpc<T>,
}
impl ActionCacheClient<tonic::transport::Channel> {
pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
where
D: TryInto<tonic::transport::Endpoint>,
D::Error: Into<StdError>,
{
let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
Ok(Self::new(conn))
}
}
impl<T> ActionCacheClient<T>
where
T: tonic::client::GrpcService<tonic::body::Body>,
T::Error: Into<StdError>,
T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
<T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
{
pub fn new(inner: T) -> Self {
let inner = tonic::client::Grpc::new(inner);
Self { inner }
}
pub fn with_origin(inner: T, origin: Uri) -> Self {
let inner = tonic::client::Grpc::with_origin(inner, origin);
Self { inner }
}
pub fn with_interceptor<F>(
inner: T,
interceptor: F,
) -> ActionCacheClient<InterceptedService<T, F>>
where
F: tonic::service::Interceptor,
T::ResponseBody: Default,
T: tonic::codegen::Service<
http::Request<tonic::body::Body>,
Response = http::Response<
<T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
>,
>,
<T as tonic::codegen::Service<
http::Request<tonic::body::Body>,
>>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
{
ActionCacheClient::new(InterceptedService::new(inner, interceptor))
}
#[must_use]
pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.inner = self.inner.send_compressed(encoding);
self
}
#[must_use]
pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.inner = self.inner.accept_compressed(encoding);
self
}
#[must_use]
pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
self.inner = self.inner.max_decoding_message_size(limit);
self
}
#[must_use]
pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
self.inner = self.inner.max_encoding_message_size(limit);
self
}
pub async fn get_action_result(
&mut self,
request: impl tonic::IntoRequest<super::GetActionResultRequest>,
) -> std::result::Result<tonic::Response<super::ActionResult>, tonic::Status> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic_prost::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/build.bazel.remote.execution.v2.ActionCache/GetActionResult",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"build.bazel.remote.execution.v2.ActionCache",
"GetActionResult",
),
);
self.inner.unary(req, path, codec).await
}
pub async fn update_action_result(
&mut self,
request: impl tonic::IntoRequest<super::UpdateActionResultRequest>,
) -> std::result::Result<tonic::Response<super::ActionResult>, tonic::Status> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic_prost::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/build.bazel.remote.execution.v2.ActionCache/UpdateActionResult",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"build.bazel.remote.execution.v2.ActionCache",
"UpdateActionResult",
),
);
self.inner.unary(req, path, codec).await
}
}
}
pub mod action_cache_server {
#![allow(
unused_variables,
dead_code,
missing_docs,
clippy::wildcard_imports,
clippy::let_unit_value,
)]
use tonic::codegen::*;
#[async_trait]
pub trait ActionCache: std::marker::Send + std::marker::Sync + 'static {
async fn get_action_result(
&self,
request: tonic::Request<super::GetActionResultRequest>,
) -> std::result::Result<tonic::Response<super::ActionResult>, tonic::Status>;
async fn update_action_result(
&self,
request: tonic::Request<super::UpdateActionResultRequest>,
) -> std::result::Result<tonic::Response<super::ActionResult>, tonic::Status>;
}
#[derive(Debug)]
pub struct ActionCacheServer<T> {
inner: Arc<T>,
accept_compression_encodings: EnabledCompressionEncodings,
send_compression_encodings: EnabledCompressionEncodings,
max_decoding_message_size: Option<usize>,
max_encoding_message_size: Option<usize>,
}
impl<T> ActionCacheServer<T> {
pub fn new(inner: T) -> Self {
Self::from_arc(Arc::new(inner))
}
pub fn from_arc(inner: Arc<T>) -> Self {
Self {
inner,
accept_compression_encodings: Default::default(),
send_compression_encodings: Default::default(),
max_decoding_message_size: None,
max_encoding_message_size: None,
}
}
pub fn with_interceptor<F>(
inner: T,
interceptor: F,
) -> InterceptedService<Self, F>
where
F: tonic::service::Interceptor,
{
InterceptedService::new(Self::new(inner), interceptor)
}
#[must_use]
pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.accept_compression_encodings.enable(encoding);
self
}
#[must_use]
pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.send_compression_encodings.enable(encoding);
self
}
#[must_use]
pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
self.max_decoding_message_size = Some(limit);
self
}
#[must_use]
pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
self.max_encoding_message_size = Some(limit);
self
}
}
impl<T, B> tonic::codegen::Service<http::Request<B>> for ActionCacheServer<T>
where
T: ActionCache,
B: Body + std::marker::Send + 'static,
B::Error: Into<StdError> + std::marker::Send + 'static,
{
type Response = http::Response<tonic::body::Body>;
type Error = std::convert::Infallible;
type Future = BoxFuture<Self::Response, Self::Error>;
fn poll_ready(
&mut self,
_cx: &mut Context<'_>,
) -> Poll<std::result::Result<(), Self::Error>> {
Poll::Ready(Ok(()))
}
fn call(&mut self, req: http::Request<B>) -> Self::Future {
match req.uri().path() {
"/build.bazel.remote.execution.v2.ActionCache/GetActionResult" => {
#[allow(non_camel_case_types)]
struct GetActionResultSvc<T: ActionCache>(pub Arc<T>);
impl<
T: ActionCache,
> tonic::server::UnaryService<super::GetActionResultRequest>
for GetActionResultSvc<T> {
type Response = super::ActionResult;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::GetActionResultRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as ActionCache>::get_action_result(&inner, request).await
};
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let max_decoding_message_size = self.max_decoding_message_size;
let max_encoding_message_size = self.max_encoding_message_size;
let inner = self.inner.clone();
let fut = async move {
let method = GetActionResultSvc(inner);
let codec = tonic_prost::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
)
.apply_max_message_size_config(
max_decoding_message_size,
max_encoding_message_size,
);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/build.bazel.remote.execution.v2.ActionCache/UpdateActionResult" => {
#[allow(non_camel_case_types)]
struct UpdateActionResultSvc<T: ActionCache>(pub Arc<T>);
impl<
T: ActionCache,
> tonic::server::UnaryService<super::UpdateActionResultRequest>
for UpdateActionResultSvc<T> {
type Response = super::ActionResult;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::UpdateActionResultRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as ActionCache>::update_action_result(&inner, request)
.await
};
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let max_decoding_message_size = self.max_decoding_message_size;
let max_encoding_message_size = self.max_encoding_message_size;
let inner = self.inner.clone();
let fut = async move {
let method = UpdateActionResultSvc(inner);
let codec = tonic_prost::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
)
.apply_max_message_size_config(
max_decoding_message_size,
max_encoding_message_size,
);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
_ => {
Box::pin(async move {
let mut response = http::Response::new(
tonic::body::Body::default(),
);
let headers = response.headers_mut();
headers
.insert(
tonic::Status::GRPC_STATUS,
(tonic::Code::Unimplemented as i32).into(),
);
headers
.insert(
http::header::CONTENT_TYPE,
tonic::metadata::GRPC_CONTENT_TYPE,
);
Ok(response)
})
}
}
}
}
impl<T> Clone for ActionCacheServer<T> {
fn clone(&self) -> Self {
let inner = self.inner.clone();
Self {
inner,
accept_compression_encodings: self.accept_compression_encodings,
send_compression_encodings: self.send_compression_encodings,
max_decoding_message_size: self.max_decoding_message_size,
max_encoding_message_size: self.max_encoding_message_size,
}
}
}
pub const SERVICE_NAME: &str = "build.bazel.remote.execution.v2.ActionCache";
impl<T> tonic::server::NamedService for ActionCacheServer<T> {
const NAME: &'static str = SERVICE_NAME;
}
}
pub mod content_addressable_storage_client {
#![allow(
unused_variables,
dead_code,
missing_docs,
clippy::wildcard_imports,
clippy::let_unit_value,
)]
use tonic::codegen::*;
use tonic::codegen::http::Uri;
#[derive(Debug, Clone)]
pub struct ContentAddressableStorageClient<T> {
inner: tonic::client::Grpc<T>,
}
impl ContentAddressableStorageClient<tonic::transport::Channel> {
pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
where
D: TryInto<tonic::transport::Endpoint>,
D::Error: Into<StdError>,
{
let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
Ok(Self::new(conn))
}
}
impl<T> ContentAddressableStorageClient<T>
where
T: tonic::client::GrpcService<tonic::body::Body>,
T::Error: Into<StdError>,
T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
<T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
{
pub fn new(inner: T) -> Self {
let inner = tonic::client::Grpc::new(inner);
Self { inner }
}
pub fn with_origin(inner: T, origin: Uri) -> Self {
let inner = tonic::client::Grpc::with_origin(inner, origin);
Self { inner }
}
pub fn with_interceptor<F>(
inner: T,
interceptor: F,
) -> ContentAddressableStorageClient<InterceptedService<T, F>>
where
F: tonic::service::Interceptor,
T::ResponseBody: Default,
T: tonic::codegen::Service<
http::Request<tonic::body::Body>,
Response = http::Response<
<T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
>,
>,
<T as tonic::codegen::Service<
http::Request<tonic::body::Body>,
>>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
{
ContentAddressableStorageClient::new(
InterceptedService::new(inner, interceptor),
)
}
#[must_use]
pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.inner = self.inner.send_compressed(encoding);
self
}
#[must_use]
pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.inner = self.inner.accept_compressed(encoding);
self
}
#[must_use]
pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
self.inner = self.inner.max_decoding_message_size(limit);
self
}
#[must_use]
pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
self.inner = self.inner.max_encoding_message_size(limit);
self
}
pub async fn find_missing_blobs(
&mut self,
request: impl tonic::IntoRequest<super::FindMissingBlobsRequest>,
) -> std::result::Result<
tonic::Response<super::FindMissingBlobsResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic_prost::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/build.bazel.remote.execution.v2.ContentAddressableStorage/FindMissingBlobs",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"build.bazel.remote.execution.v2.ContentAddressableStorage",
"FindMissingBlobs",
),
);
self.inner.unary(req, path, codec).await
}
pub async fn batch_update_blobs(
&mut self,
request: impl tonic::IntoRequest<super::BatchUpdateBlobsRequest>,
) -> std::result::Result<
tonic::Response<super::BatchUpdateBlobsResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic_prost::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/build.bazel.remote.execution.v2.ContentAddressableStorage/BatchUpdateBlobs",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"build.bazel.remote.execution.v2.ContentAddressableStorage",
"BatchUpdateBlobs",
),
);
self.inner.unary(req, path, codec).await
}
pub async fn batch_read_blobs(
&mut self,
request: impl tonic::IntoRequest<super::BatchReadBlobsRequest>,
) -> std::result::Result<
tonic::Response<super::BatchReadBlobsResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic_prost::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/build.bazel.remote.execution.v2.ContentAddressableStorage/BatchReadBlobs",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"build.bazel.remote.execution.v2.ContentAddressableStorage",
"BatchReadBlobs",
),
);
self.inner.unary(req, path, codec).await
}
pub async fn get_tree(
&mut self,
request: impl tonic::IntoRequest<super::GetTreeRequest>,
) -> std::result::Result<
tonic::Response<tonic::codec::Streaming<super::GetTreeResponse>>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic_prost::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/build.bazel.remote.execution.v2.ContentAddressableStorage/GetTree",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"build.bazel.remote.execution.v2.ContentAddressableStorage",
"GetTree",
),
);
self.inner.server_streaming(req, path, codec).await
}
pub async fn split_blob(
&mut self,
request: impl tonic::IntoRequest<super::SplitBlobRequest>,
) -> std::result::Result<
tonic::Response<super::SplitBlobResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic_prost::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/build.bazel.remote.execution.v2.ContentAddressableStorage/SplitBlob",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"build.bazel.remote.execution.v2.ContentAddressableStorage",
"SplitBlob",
),
);
self.inner.unary(req, path, codec).await
}
pub async fn get_chunk_mapping(
&mut self,
request: impl tonic::IntoRequest<super::GetChunkMappingRequest>,
) -> std::result::Result<
tonic::Response<tonic::codec::Streaming<super::GetChunkMappingResponse>>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic_prost::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/build.bazel.remote.execution.v2.ContentAddressableStorage/GetChunkMapping",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"build.bazel.remote.execution.v2.ContentAddressableStorage",
"GetChunkMapping",
),
);
self.inner.server_streaming(req, path, codec).await
}
pub async fn splice_blob(
&mut self,
request: impl tonic::IntoRequest<super::SpliceBlobRequest>,
) -> std::result::Result<
tonic::Response<super::SpliceBlobResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic_prost::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/build.bazel.remote.execution.v2.ContentAddressableStorage/SpliceBlob",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"build.bazel.remote.execution.v2.ContentAddressableStorage",
"SpliceBlob",
),
);
self.inner.unary(req, path, codec).await
}
pub async fn register_chunk_mapping(
&mut self,
request: impl tonic::IntoStreamingRequest<
Message = super::RegisterChunkMappingRequest,
>,
) -> std::result::Result<
tonic::Response<super::RegisterChunkMappingResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic_prost::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/build.bazel.remote.execution.v2.ContentAddressableStorage/RegisterChunkMapping",
);
let mut req = request.into_streaming_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"build.bazel.remote.execution.v2.ContentAddressableStorage",
"RegisterChunkMapping",
),
);
self.inner.client_streaming(req, path, codec).await
}
}
}
pub mod content_addressable_storage_server {
#![allow(
unused_variables,
dead_code,
missing_docs,
clippy::wildcard_imports,
clippy::let_unit_value,
)]
use tonic::codegen::*;
#[async_trait]
pub trait ContentAddressableStorage: std::marker::Send + std::marker::Sync + 'static {
async fn find_missing_blobs(
&self,
request: tonic::Request<super::FindMissingBlobsRequest>,
) -> std::result::Result<
tonic::Response<super::FindMissingBlobsResponse>,
tonic::Status,
>;
async fn batch_update_blobs(
&self,
request: tonic::Request<super::BatchUpdateBlobsRequest>,
) -> std::result::Result<
tonic::Response<super::BatchUpdateBlobsResponse>,
tonic::Status,
>;
async fn batch_read_blobs(
&self,
request: tonic::Request<super::BatchReadBlobsRequest>,
) -> std::result::Result<
tonic::Response<super::BatchReadBlobsResponse>,
tonic::Status,
>;
type GetTreeStream: tonic::codegen::tokio_stream::Stream<
Item = std::result::Result<super::GetTreeResponse, tonic::Status>,
>
+ std::marker::Send
+ 'static;
async fn get_tree(
&self,
request: tonic::Request<super::GetTreeRequest>,
) -> std::result::Result<tonic::Response<Self::GetTreeStream>, tonic::Status>;
async fn split_blob(
&self,
request: tonic::Request<super::SplitBlobRequest>,
) -> std::result::Result<
tonic::Response<super::SplitBlobResponse>,
tonic::Status,
>;
type GetChunkMappingStream: tonic::codegen::tokio_stream::Stream<
Item = std::result::Result<super::GetChunkMappingResponse, tonic::Status>,
>
+ std::marker::Send
+ 'static;
async fn get_chunk_mapping(
&self,
request: tonic::Request<super::GetChunkMappingRequest>,
) -> std::result::Result<
tonic::Response<Self::GetChunkMappingStream>,
tonic::Status,
>;
async fn splice_blob(
&self,
request: tonic::Request<super::SpliceBlobRequest>,
) -> std::result::Result<
tonic::Response<super::SpliceBlobResponse>,
tonic::Status,
>;
async fn register_chunk_mapping(
&self,
request: tonic::Request<tonic::Streaming<super::RegisterChunkMappingRequest>>,
) -> std::result::Result<
tonic::Response<super::RegisterChunkMappingResponse>,
tonic::Status,
>;
}
#[derive(Debug)]
pub struct ContentAddressableStorageServer<T> {
inner: Arc<T>,
accept_compression_encodings: EnabledCompressionEncodings,
send_compression_encodings: EnabledCompressionEncodings,
max_decoding_message_size: Option<usize>,
max_encoding_message_size: Option<usize>,
}
impl<T> ContentAddressableStorageServer<T> {
pub fn new(inner: T) -> Self {
Self::from_arc(Arc::new(inner))
}
pub fn from_arc(inner: Arc<T>) -> Self {
Self {
inner,
accept_compression_encodings: Default::default(),
send_compression_encodings: Default::default(),
max_decoding_message_size: None,
max_encoding_message_size: None,
}
}
pub fn with_interceptor<F>(
inner: T,
interceptor: F,
) -> InterceptedService<Self, F>
where
F: tonic::service::Interceptor,
{
InterceptedService::new(Self::new(inner), interceptor)
}
#[must_use]
pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.accept_compression_encodings.enable(encoding);
self
}
#[must_use]
pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.send_compression_encodings.enable(encoding);
self
}
#[must_use]
pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
self.max_decoding_message_size = Some(limit);
self
}
#[must_use]
pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
self.max_encoding_message_size = Some(limit);
self
}
}
impl<T, B> tonic::codegen::Service<http::Request<B>>
for ContentAddressableStorageServer<T>
where
T: ContentAddressableStorage,
B: Body + std::marker::Send + 'static,
B::Error: Into<StdError> + std::marker::Send + 'static,
{
type Response = http::Response<tonic::body::Body>;
type Error = std::convert::Infallible;
type Future = BoxFuture<Self::Response, Self::Error>;
fn poll_ready(
&mut self,
_cx: &mut Context<'_>,
) -> Poll<std::result::Result<(), Self::Error>> {
Poll::Ready(Ok(()))
}
fn call(&mut self, req: http::Request<B>) -> Self::Future {
match req.uri().path() {
"/build.bazel.remote.execution.v2.ContentAddressableStorage/FindMissingBlobs" => {
#[allow(non_camel_case_types)]
struct FindMissingBlobsSvc<T: ContentAddressableStorage>(pub Arc<T>);
impl<
T: ContentAddressableStorage,
> tonic::server::UnaryService<super::FindMissingBlobsRequest>
for FindMissingBlobsSvc<T> {
type Response = super::FindMissingBlobsResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::FindMissingBlobsRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as ContentAddressableStorage>::find_missing_blobs(
&inner,
request,
)
.await
};
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let max_decoding_message_size = self.max_decoding_message_size;
let max_encoding_message_size = self.max_encoding_message_size;
let inner = self.inner.clone();
let fut = async move {
let method = FindMissingBlobsSvc(inner);
let codec = tonic_prost::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
)
.apply_max_message_size_config(
max_decoding_message_size,
max_encoding_message_size,
);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/build.bazel.remote.execution.v2.ContentAddressableStorage/BatchUpdateBlobs" => {
#[allow(non_camel_case_types)]
struct BatchUpdateBlobsSvc<T: ContentAddressableStorage>(pub Arc<T>);
impl<
T: ContentAddressableStorage,
> tonic::server::UnaryService<super::BatchUpdateBlobsRequest>
for BatchUpdateBlobsSvc<T> {
type Response = super::BatchUpdateBlobsResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::BatchUpdateBlobsRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as ContentAddressableStorage>::batch_update_blobs(
&inner,
request,
)
.await
};
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let max_decoding_message_size = self.max_decoding_message_size;
let max_encoding_message_size = self.max_encoding_message_size;
let inner = self.inner.clone();
let fut = async move {
let method = BatchUpdateBlobsSvc(inner);
let codec = tonic_prost::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
)
.apply_max_message_size_config(
max_decoding_message_size,
max_encoding_message_size,
);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/build.bazel.remote.execution.v2.ContentAddressableStorage/BatchReadBlobs" => {
#[allow(non_camel_case_types)]
struct BatchReadBlobsSvc<T: ContentAddressableStorage>(pub Arc<T>);
impl<
T: ContentAddressableStorage,
> tonic::server::UnaryService<super::BatchReadBlobsRequest>
for BatchReadBlobsSvc<T> {
type Response = super::BatchReadBlobsResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::BatchReadBlobsRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as ContentAddressableStorage>::batch_read_blobs(
&inner,
request,
)
.await
};
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let max_decoding_message_size = self.max_decoding_message_size;
let max_encoding_message_size = self.max_encoding_message_size;
let inner = self.inner.clone();
let fut = async move {
let method = BatchReadBlobsSvc(inner);
let codec = tonic_prost::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
)
.apply_max_message_size_config(
max_decoding_message_size,
max_encoding_message_size,
);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/build.bazel.remote.execution.v2.ContentAddressableStorage/GetTree" => {
#[allow(non_camel_case_types)]
struct GetTreeSvc<T: ContentAddressableStorage>(pub Arc<T>);
impl<
T: ContentAddressableStorage,
> tonic::server::ServerStreamingService<super::GetTreeRequest>
for GetTreeSvc<T> {
type Response = super::GetTreeResponse;
type ResponseStream = T::GetTreeStream;
type Future = BoxFuture<
tonic::Response<Self::ResponseStream>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::GetTreeRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as ContentAddressableStorage>::get_tree(&inner, request)
.await
};
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let max_decoding_message_size = self.max_decoding_message_size;
let max_encoding_message_size = self.max_encoding_message_size;
let inner = self.inner.clone();
let fut = async move {
let method = GetTreeSvc(inner);
let codec = tonic_prost::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
)
.apply_max_message_size_config(
max_decoding_message_size,
max_encoding_message_size,
);
let res = grpc.server_streaming(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/build.bazel.remote.execution.v2.ContentAddressableStorage/SplitBlob" => {
#[allow(non_camel_case_types)]
struct SplitBlobSvc<T: ContentAddressableStorage>(pub Arc<T>);
impl<
T: ContentAddressableStorage,
> tonic::server::UnaryService<super::SplitBlobRequest>
for SplitBlobSvc<T> {
type Response = super::SplitBlobResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::SplitBlobRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as ContentAddressableStorage>::split_blob(
&inner,
request,
)
.await
};
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let max_decoding_message_size = self.max_decoding_message_size;
let max_encoding_message_size = self.max_encoding_message_size;
let inner = self.inner.clone();
let fut = async move {
let method = SplitBlobSvc(inner);
let codec = tonic_prost::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
)
.apply_max_message_size_config(
max_decoding_message_size,
max_encoding_message_size,
);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/build.bazel.remote.execution.v2.ContentAddressableStorage/GetChunkMapping" => {
#[allow(non_camel_case_types)]
struct GetChunkMappingSvc<T: ContentAddressableStorage>(pub Arc<T>);
impl<
T: ContentAddressableStorage,
> tonic::server::ServerStreamingService<
super::GetChunkMappingRequest,
> for GetChunkMappingSvc<T> {
type Response = super::GetChunkMappingResponse;
type ResponseStream = T::GetChunkMappingStream;
type Future = BoxFuture<
tonic::Response<Self::ResponseStream>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::GetChunkMappingRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as ContentAddressableStorage>::get_chunk_mapping(
&inner,
request,
)
.await
};
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let max_decoding_message_size = self.max_decoding_message_size;
let max_encoding_message_size = self.max_encoding_message_size;
let inner = self.inner.clone();
let fut = async move {
let method = GetChunkMappingSvc(inner);
let codec = tonic_prost::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
)
.apply_max_message_size_config(
max_decoding_message_size,
max_encoding_message_size,
);
let res = grpc.server_streaming(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/build.bazel.remote.execution.v2.ContentAddressableStorage/SpliceBlob" => {
#[allow(non_camel_case_types)]
struct SpliceBlobSvc<T: ContentAddressableStorage>(pub Arc<T>);
impl<
T: ContentAddressableStorage,
> tonic::server::UnaryService<super::SpliceBlobRequest>
for SpliceBlobSvc<T> {
type Response = super::SpliceBlobResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::SpliceBlobRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as ContentAddressableStorage>::splice_blob(
&inner,
request,
)
.await
};
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let max_decoding_message_size = self.max_decoding_message_size;
let max_encoding_message_size = self.max_encoding_message_size;
let inner = self.inner.clone();
let fut = async move {
let method = SpliceBlobSvc(inner);
let codec = tonic_prost::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
)
.apply_max_message_size_config(
max_decoding_message_size,
max_encoding_message_size,
);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/build.bazel.remote.execution.v2.ContentAddressableStorage/RegisterChunkMapping" => {
#[allow(non_camel_case_types)]
struct RegisterChunkMappingSvc<T: ContentAddressableStorage>(
pub Arc<T>,
);
impl<
T: ContentAddressableStorage,
> tonic::server::ClientStreamingService<
super::RegisterChunkMappingRequest,
> for RegisterChunkMappingSvc<T> {
type Response = super::RegisterChunkMappingResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<
tonic::Streaming<super::RegisterChunkMappingRequest>,
>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as ContentAddressableStorage>::register_chunk_mapping(
&inner,
request,
)
.await
};
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let max_decoding_message_size = self.max_decoding_message_size;
let max_encoding_message_size = self.max_encoding_message_size;
let inner = self.inner.clone();
let fut = async move {
let method = RegisterChunkMappingSvc(inner);
let codec = tonic_prost::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
)
.apply_max_message_size_config(
max_decoding_message_size,
max_encoding_message_size,
);
let res = grpc.client_streaming(method, req).await;
Ok(res)
};
Box::pin(fut)
}
_ => {
Box::pin(async move {
let mut response = http::Response::new(
tonic::body::Body::default(),
);
let headers = response.headers_mut();
headers
.insert(
tonic::Status::GRPC_STATUS,
(tonic::Code::Unimplemented as i32).into(),
);
headers
.insert(
http::header::CONTENT_TYPE,
tonic::metadata::GRPC_CONTENT_TYPE,
);
Ok(response)
})
}
}
}
}
impl<T> Clone for ContentAddressableStorageServer<T> {
fn clone(&self) -> Self {
let inner = self.inner.clone();
Self {
inner,
accept_compression_encodings: self.accept_compression_encodings,
send_compression_encodings: self.send_compression_encodings,
max_decoding_message_size: self.max_decoding_message_size,
max_encoding_message_size: self.max_encoding_message_size,
}
}
}
pub const SERVICE_NAME: &str = "build.bazel.remote.execution.v2.ContentAddressableStorage";
impl<T> tonic::server::NamedService for ContentAddressableStorageServer<T> {
const NAME: &'static str = SERVICE_NAME;
}
}
pub mod capabilities_client {
#![allow(
unused_variables,
dead_code,
missing_docs,
clippy::wildcard_imports,
clippy::let_unit_value,
)]
use tonic::codegen::*;
use tonic::codegen::http::Uri;
#[derive(Debug, Clone)]
pub struct CapabilitiesClient<T> {
inner: tonic::client::Grpc<T>,
}
impl CapabilitiesClient<tonic::transport::Channel> {
pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
where
D: TryInto<tonic::transport::Endpoint>,
D::Error: Into<StdError>,
{
let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
Ok(Self::new(conn))
}
}
impl<T> CapabilitiesClient<T>
where
T: tonic::client::GrpcService<tonic::body::Body>,
T::Error: Into<StdError>,
T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
<T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
{
pub fn new(inner: T) -> Self {
let inner = tonic::client::Grpc::new(inner);
Self { inner }
}
pub fn with_origin(inner: T, origin: Uri) -> Self {
let inner = tonic::client::Grpc::with_origin(inner, origin);
Self { inner }
}
pub fn with_interceptor<F>(
inner: T,
interceptor: F,
) -> CapabilitiesClient<InterceptedService<T, F>>
where
F: tonic::service::Interceptor,
T::ResponseBody: Default,
T: tonic::codegen::Service<
http::Request<tonic::body::Body>,
Response = http::Response<
<T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
>,
>,
<T as tonic::codegen::Service<
http::Request<tonic::body::Body>,
>>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
{
CapabilitiesClient::new(InterceptedService::new(inner, interceptor))
}
#[must_use]
pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.inner = self.inner.send_compressed(encoding);
self
}
#[must_use]
pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.inner = self.inner.accept_compressed(encoding);
self
}
#[must_use]
pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
self.inner = self.inner.max_decoding_message_size(limit);
self
}
#[must_use]
pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
self.inner = self.inner.max_encoding_message_size(limit);
self
}
pub async fn get_capabilities(
&mut self,
request: impl tonic::IntoRequest<super::GetCapabilitiesRequest>,
) -> std::result::Result<
tonic::Response<super::ServerCapabilities>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic_prost::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/build.bazel.remote.execution.v2.Capabilities/GetCapabilities",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"build.bazel.remote.execution.v2.Capabilities",
"GetCapabilities",
),
);
self.inner.unary(req, path, codec).await
}
}
}
pub mod capabilities_server {
#![allow(
unused_variables,
dead_code,
missing_docs,
clippy::wildcard_imports,
clippy::let_unit_value,
)]
use tonic::codegen::*;
#[async_trait]
pub trait Capabilities: std::marker::Send + std::marker::Sync + 'static {
async fn get_capabilities(
&self,
request: tonic::Request<super::GetCapabilitiesRequest>,
) -> std::result::Result<
tonic::Response<super::ServerCapabilities>,
tonic::Status,
>;
}
#[derive(Debug)]
pub struct CapabilitiesServer<T> {
inner: Arc<T>,
accept_compression_encodings: EnabledCompressionEncodings,
send_compression_encodings: EnabledCompressionEncodings,
max_decoding_message_size: Option<usize>,
max_encoding_message_size: Option<usize>,
}
impl<T> CapabilitiesServer<T> {
pub fn new(inner: T) -> Self {
Self::from_arc(Arc::new(inner))
}
pub fn from_arc(inner: Arc<T>) -> Self {
Self {
inner,
accept_compression_encodings: Default::default(),
send_compression_encodings: Default::default(),
max_decoding_message_size: None,
max_encoding_message_size: None,
}
}
pub fn with_interceptor<F>(
inner: T,
interceptor: F,
) -> InterceptedService<Self, F>
where
F: tonic::service::Interceptor,
{
InterceptedService::new(Self::new(inner), interceptor)
}
#[must_use]
pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.accept_compression_encodings.enable(encoding);
self
}
#[must_use]
pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.send_compression_encodings.enable(encoding);
self
}
#[must_use]
pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
self.max_decoding_message_size = Some(limit);
self
}
#[must_use]
pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
self.max_encoding_message_size = Some(limit);
self
}
}
impl<T, B> tonic::codegen::Service<http::Request<B>> for CapabilitiesServer<T>
where
T: Capabilities,
B: Body + std::marker::Send + 'static,
B::Error: Into<StdError> + std::marker::Send + 'static,
{
type Response = http::Response<tonic::body::Body>;
type Error = std::convert::Infallible;
type Future = BoxFuture<Self::Response, Self::Error>;
fn poll_ready(
&mut self,
_cx: &mut Context<'_>,
) -> Poll<std::result::Result<(), Self::Error>> {
Poll::Ready(Ok(()))
}
fn call(&mut self, req: http::Request<B>) -> Self::Future {
match req.uri().path() {
"/build.bazel.remote.execution.v2.Capabilities/GetCapabilities" => {
#[allow(non_camel_case_types)]
struct GetCapabilitiesSvc<T: Capabilities>(pub Arc<T>);
impl<
T: Capabilities,
> tonic::server::UnaryService<super::GetCapabilitiesRequest>
for GetCapabilitiesSvc<T> {
type Response = super::ServerCapabilities;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::GetCapabilitiesRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as Capabilities>::get_capabilities(&inner, request).await
};
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let max_decoding_message_size = self.max_decoding_message_size;
let max_encoding_message_size = self.max_encoding_message_size;
let inner = self.inner.clone();
let fut = async move {
let method = GetCapabilitiesSvc(inner);
let codec = tonic_prost::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
)
.apply_max_message_size_config(
max_decoding_message_size,
max_encoding_message_size,
);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
_ => {
Box::pin(async move {
let mut response = http::Response::new(
tonic::body::Body::default(),
);
let headers = response.headers_mut();
headers
.insert(
tonic::Status::GRPC_STATUS,
(tonic::Code::Unimplemented as i32).into(),
);
headers
.insert(
http::header::CONTENT_TYPE,
tonic::metadata::GRPC_CONTENT_TYPE,
);
Ok(response)
})
}
}
}
}
impl<T> Clone for CapabilitiesServer<T> {
fn clone(&self) -> Self {
let inner = self.inner.clone();
Self {
inner,
accept_compression_encodings: self.accept_compression_encodings,
send_compression_encodings: self.send_compression_encodings,
max_decoding_message_size: self.max_decoding_message_size,
max_encoding_message_size: self.max_encoding_message_size,
}
}
}
pub const SERVICE_NAME: &str = "build.bazel.remote.execution.v2.Capabilities";
impl<T> tonic::server::NamedService for CapabilitiesServer<T> {
const NAME: &'static str = SERVICE_NAME;
}
}