#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ChainsRequest {
#[prost(uint64, tag = "1")]
pub isd_as: u64,
#[prost(bytes = "vec", tag = "2")]
pub subject_key_id: ::prost::alloc::vec::Vec<u8>,
#[prost(message, optional, tag = "3")]
pub at_least_valid_until: ::core::option::Option<::prost_types::Timestamp>,
#[prost(message, optional, tag = "4")]
pub at_least_valid_since: ::core::option::Option<::prost_types::Timestamp>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ChainsResponse {
#[prost(message, repeated, tag = "1")]
pub chains: ::prost::alloc::vec::Vec<Chain>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Chain {
#[prost(bytes = "vec", tag = "1")]
pub as_cert: ::prost::alloc::vec::Vec<u8>,
#[prost(bytes = "vec", tag = "2")]
pub ca_cert: ::prost::alloc::vec::Vec<u8>,
}
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct TrcRequest {
#[prost(uint32, tag = "1")]
pub isd: u32,
#[prost(uint64, tag = "2")]
pub base: u64,
#[prost(uint64, tag = "3")]
pub serial: u64,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct TrcResponse {
#[prost(bytes = "vec", tag = "1")]
pub trc: ::prost::alloc::vec::Vec<u8>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct VerificationKeyId {
#[prost(uint64, tag = "1")]
pub isd_as: u64,
#[prost(bytes = "vec", tag = "2")]
pub subject_key_id: ::prost::alloc::vec::Vec<u8>,
#[prost(uint64, tag = "3")]
pub trc_base: u64,
#[prost(uint64, tag = "4")]
pub trc_serial: u64,
}
pub mod trust_material_service_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 TrustMaterialServiceClient<T> {
inner: tonic::client::Grpc<T>,
}
impl TrustMaterialServiceClient<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> TrustMaterialServiceClient<T>
where
T: tonic::client::GrpcService<tonic::body::BoxBody>,
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,
) -> TrustMaterialServiceClient<InterceptedService<T, F>>
where
F: tonic::service::Interceptor,
T::ResponseBody: Default,
T: tonic::codegen::Service<
http::Request<tonic::body::BoxBody>,
Response = http::Response<
<T as tonic::client::GrpcService<tonic::body::BoxBody>>::ResponseBody,
>,
>,
<T as tonic::codegen::Service<
http::Request<tonic::body::BoxBody>,
>>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
{
TrustMaterialServiceClient::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 chains(
&mut self,
request: impl tonic::IntoRequest<super::ChainsRequest>,
) -> std::result::Result<tonic::Response<super::ChainsResponse>, tonic::Status> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/proto.control_plane.v1.TrustMaterialService/Chains",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"proto.control_plane.v1.TrustMaterialService",
"Chains",
),
);
self.inner.unary(req, path, codec).await
}
pub async fn trc(
&mut self,
request: impl tonic::IntoRequest<super::TrcRequest>,
) -> std::result::Result<tonic::Response<super::TrcResponse>, tonic::Status> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/proto.control_plane.v1.TrustMaterialService/TRC",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new("proto.control_plane.v1.TrustMaterialService", "TRC"),
);
self.inner.unary(req, path, codec).await
}
}
}
pub mod trust_material_service_server {
#![allow(
unused_variables,
dead_code,
missing_docs,
clippy::wildcard_imports,
clippy::let_unit_value,
)]
use tonic::codegen::*;
#[async_trait]
pub trait TrustMaterialService: std::marker::Send + std::marker::Sync + 'static {
async fn chains(
&self,
request: tonic::Request<super::ChainsRequest>,
) -> std::result::Result<tonic::Response<super::ChainsResponse>, tonic::Status>;
async fn trc(
&self,
request: tonic::Request<super::TrcRequest>,
) -> std::result::Result<tonic::Response<super::TrcResponse>, tonic::Status>;
}
#[derive(Debug)]
pub struct TrustMaterialServiceServer<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> TrustMaterialServiceServer<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 TrustMaterialServiceServer<T>
where
T: TrustMaterialService,
B: Body + std::marker::Send + 'static,
B::Error: Into<StdError> + std::marker::Send + 'static,
{
type Response = http::Response<tonic::body::BoxBody>;
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() {
"/proto.control_plane.v1.TrustMaterialService/Chains" => {
#[allow(non_camel_case_types)]
struct ChainsSvc<T: TrustMaterialService>(pub Arc<T>);
impl<
T: TrustMaterialService,
> tonic::server::UnaryService<super::ChainsRequest>
for ChainsSvc<T> {
type Response = super::ChainsResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::ChainsRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as TrustMaterialService>::chains(&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 = ChainsSvc(inner);
let codec = tonic::codec::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)
}
"/proto.control_plane.v1.TrustMaterialService/TRC" => {
#[allow(non_camel_case_types)]
struct TRCSvc<T: TrustMaterialService>(pub Arc<T>);
impl<
T: TrustMaterialService,
> tonic::server::UnaryService<super::TrcRequest> for TRCSvc<T> {
type Response = super::TrcResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::TrcRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as TrustMaterialService>::trc(&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 = TRCSvc(inner);
let codec = tonic::codec::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(empty_body());
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 TrustMaterialServiceServer<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 = "proto.control_plane.v1.TrustMaterialService";
impl<T> tonic::server::NamedService for TrustMaterialServiceServer<T> {
const NAME: &'static str = SERVICE_NAME;
}
}
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct DrKeySecretValueRequest {
#[prost(message, optional, tag = "1")]
pub val_time: ::core::option::Option<::prost_types::Timestamp>,
#[prost(enumeration = "super::super::drkey::v1::Protocol", tag = "2")]
pub protocol_id: i32,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DrKeySecretValueResponse {
#[prost(message, optional, tag = "1")]
pub epoch_begin: ::core::option::Option<::prost_types::Timestamp>,
#[prost(message, optional, tag = "2")]
pub epoch_end: ::core::option::Option<::prost_types::Timestamp>,
#[prost(bytes = "vec", tag = "3")]
pub key: ::prost::alloc::vec::Vec<u8>,
}
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct DrKeyLevel1Request {
#[prost(message, optional, tag = "1")]
pub val_time: ::core::option::Option<::prost_types::Timestamp>,
#[prost(enumeration = "super::super::drkey::v1::Protocol", tag = "2")]
pub protocol_id: i32,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DrKeyLevel1Response {
#[prost(message, optional, tag = "1")]
pub epoch_begin: ::core::option::Option<::prost_types::Timestamp>,
#[prost(message, optional, tag = "2")]
pub epoch_end: ::core::option::Option<::prost_types::Timestamp>,
#[prost(bytes = "vec", tag = "3")]
pub key: ::prost::alloc::vec::Vec<u8>,
}
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct DrKeyIntraLevel1Request {
#[prost(message, optional, tag = "1")]
pub val_time: ::core::option::Option<::prost_types::Timestamp>,
#[prost(enumeration = "super::super::drkey::v1::Protocol", tag = "2")]
pub protocol_id: i32,
#[prost(uint64, tag = "3")]
pub src_ia: u64,
#[prost(uint64, tag = "4")]
pub dst_ia: u64,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DrKeyIntraLevel1Response {
#[prost(message, optional, tag = "1")]
pub epoch_begin: ::core::option::Option<::prost_types::Timestamp>,
#[prost(message, optional, tag = "2")]
pub epoch_end: ::core::option::Option<::prost_types::Timestamp>,
#[prost(bytes = "vec", tag = "3")]
pub key: ::prost::alloc::vec::Vec<u8>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DrKeyHostAsRequest {
#[prost(message, optional, tag = "1")]
pub val_time: ::core::option::Option<::prost_types::Timestamp>,
#[prost(enumeration = "super::super::drkey::v1::Protocol", tag = "2")]
pub protocol_id: i32,
#[prost(uint64, tag = "3")]
pub src_ia: u64,
#[prost(uint64, tag = "4")]
pub dst_ia: u64,
#[prost(string, tag = "5")]
pub src_host: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DrKeyHostAsResponse {
#[prost(message, optional, tag = "1")]
pub epoch_begin: ::core::option::Option<::prost_types::Timestamp>,
#[prost(message, optional, tag = "2")]
pub epoch_end: ::core::option::Option<::prost_types::Timestamp>,
#[prost(bytes = "vec", tag = "3")]
pub key: ::prost::alloc::vec::Vec<u8>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DrKeyAsHostRequest {
#[prost(message, optional, tag = "1")]
pub val_time: ::core::option::Option<::prost_types::Timestamp>,
#[prost(enumeration = "super::super::drkey::v1::Protocol", tag = "2")]
pub protocol_id: i32,
#[prost(uint64, tag = "3")]
pub src_ia: u64,
#[prost(uint64, tag = "4")]
pub dst_ia: u64,
#[prost(string, tag = "5")]
pub dst_host: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DrKeyAsHostResponse {
#[prost(message, optional, tag = "1")]
pub epoch_begin: ::core::option::Option<::prost_types::Timestamp>,
#[prost(message, optional, tag = "2")]
pub epoch_end: ::core::option::Option<::prost_types::Timestamp>,
#[prost(bytes = "vec", tag = "3")]
pub key: ::prost::alloc::vec::Vec<u8>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DrKeyHostHostRequest {
#[prost(message, optional, tag = "1")]
pub val_time: ::core::option::Option<::prost_types::Timestamp>,
#[prost(enumeration = "super::super::drkey::v1::Protocol", tag = "2")]
pub protocol_id: i32,
#[prost(uint64, tag = "3")]
pub src_ia: u64,
#[prost(uint64, tag = "4")]
pub dst_ia: u64,
#[prost(string, tag = "5")]
pub src_host: ::prost::alloc::string::String,
#[prost(string, tag = "6")]
pub dst_host: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DrKeyHostHostResponse {
#[prost(message, optional, tag = "1")]
pub epoch_begin: ::core::option::Option<::prost_types::Timestamp>,
#[prost(message, optional, tag = "2")]
pub epoch_end: ::core::option::Option<::prost_types::Timestamp>,
#[prost(bytes = "vec", tag = "3")]
pub key: ::prost::alloc::vec::Vec<u8>,
}
pub mod dr_key_inter_service_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 DrKeyInterServiceClient<T> {
inner: tonic::client::Grpc<T>,
}
impl DrKeyInterServiceClient<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> DrKeyInterServiceClient<T>
where
T: tonic::client::GrpcService<tonic::body::BoxBody>,
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,
) -> DrKeyInterServiceClient<InterceptedService<T, F>>
where
F: tonic::service::Interceptor,
T::ResponseBody: Default,
T: tonic::codegen::Service<
http::Request<tonic::body::BoxBody>,
Response = http::Response<
<T as tonic::client::GrpcService<tonic::body::BoxBody>>::ResponseBody,
>,
>,
<T as tonic::codegen::Service<
http::Request<tonic::body::BoxBody>,
>>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
{
DrKeyInterServiceClient::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 dr_key_level1(
&mut self,
request: impl tonic::IntoRequest<super::DrKeyLevel1Request>,
) -> std::result::Result<
tonic::Response<super::DrKeyLevel1Response>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/proto.control_plane.v1.DRKeyInterService/DRKeyLevel1",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"proto.control_plane.v1.DRKeyInterService",
"DRKeyLevel1",
),
);
self.inner.unary(req, path, codec).await
}
}
}
pub mod dr_key_intra_service_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 DrKeyIntraServiceClient<T> {
inner: tonic::client::Grpc<T>,
}
impl DrKeyIntraServiceClient<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> DrKeyIntraServiceClient<T>
where
T: tonic::client::GrpcService<tonic::body::BoxBody>,
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,
) -> DrKeyIntraServiceClient<InterceptedService<T, F>>
where
F: tonic::service::Interceptor,
T::ResponseBody: Default,
T: tonic::codegen::Service<
http::Request<tonic::body::BoxBody>,
Response = http::Response<
<T as tonic::client::GrpcService<tonic::body::BoxBody>>::ResponseBody,
>,
>,
<T as tonic::codegen::Service<
http::Request<tonic::body::BoxBody>,
>>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
{
DrKeyIntraServiceClient::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 dr_key_intra_level1(
&mut self,
request: impl tonic::IntoRequest<super::DrKeyIntraLevel1Request>,
) -> std::result::Result<
tonic::Response<super::DrKeyIntraLevel1Response>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/proto.control_plane.v1.DRKeyIntraService/DRKeyIntraLevel1",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"proto.control_plane.v1.DRKeyIntraService",
"DRKeyIntraLevel1",
),
);
self.inner.unary(req, path, codec).await
}
pub async fn dr_key_as_host(
&mut self,
request: impl tonic::IntoRequest<super::DrKeyAsHostRequest>,
) -> std::result::Result<
tonic::Response<super::DrKeyAsHostResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/proto.control_plane.v1.DRKeyIntraService/DRKeyASHost",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"proto.control_plane.v1.DRKeyIntraService",
"DRKeyASHost",
),
);
self.inner.unary(req, path, codec).await
}
pub async fn dr_key_host_as(
&mut self,
request: impl tonic::IntoRequest<super::DrKeyHostAsRequest>,
) -> std::result::Result<
tonic::Response<super::DrKeyHostAsResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/proto.control_plane.v1.DRKeyIntraService/DRKeyHostAS",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"proto.control_plane.v1.DRKeyIntraService",
"DRKeyHostAS",
),
);
self.inner.unary(req, path, codec).await
}
pub async fn dr_key_host_host(
&mut self,
request: impl tonic::IntoRequest<super::DrKeyHostHostRequest>,
) -> std::result::Result<
tonic::Response<super::DrKeyHostHostResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/proto.control_plane.v1.DRKeyIntraService/DRKeyHostHost",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"proto.control_plane.v1.DRKeyIntraService",
"DRKeyHostHost",
),
);
self.inner.unary(req, path, codec).await
}
pub async fn dr_key_secret_value(
&mut self,
request: impl tonic::IntoRequest<super::DrKeySecretValueRequest>,
) -> std::result::Result<
tonic::Response<super::DrKeySecretValueResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/proto.control_plane.v1.DRKeyIntraService/DRKeySecretValue",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"proto.control_plane.v1.DRKeyIntraService",
"DRKeySecretValue",
),
);
self.inner.unary(req, path, codec).await
}
}
}
pub mod dr_key_inter_service_server {
#![allow(
unused_variables,
dead_code,
missing_docs,
clippy::wildcard_imports,
clippy::let_unit_value,
)]
use tonic::codegen::*;
#[async_trait]
pub trait DrKeyInterService: std::marker::Send + std::marker::Sync + 'static {
async fn dr_key_level1(
&self,
request: tonic::Request<super::DrKeyLevel1Request>,
) -> std::result::Result<
tonic::Response<super::DrKeyLevel1Response>,
tonic::Status,
>;
}
#[derive(Debug)]
pub struct DrKeyInterServiceServer<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> DrKeyInterServiceServer<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 DrKeyInterServiceServer<T>
where
T: DrKeyInterService,
B: Body + std::marker::Send + 'static,
B::Error: Into<StdError> + std::marker::Send + 'static,
{
type Response = http::Response<tonic::body::BoxBody>;
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() {
"/proto.control_plane.v1.DRKeyInterService/DRKeyLevel1" => {
#[allow(non_camel_case_types)]
struct DRKeyLevel1Svc<T: DrKeyInterService>(pub Arc<T>);
impl<
T: DrKeyInterService,
> tonic::server::UnaryService<super::DrKeyLevel1Request>
for DRKeyLevel1Svc<T> {
type Response = super::DrKeyLevel1Response;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::DrKeyLevel1Request>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as DrKeyInterService>::dr_key_level1(&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 = DRKeyLevel1Svc(inner);
let codec = tonic::codec::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(empty_body());
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 DrKeyInterServiceServer<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 = "proto.control_plane.v1.DRKeyInterService";
impl<T> tonic::server::NamedService for DrKeyInterServiceServer<T> {
const NAME: &'static str = SERVICE_NAME;
}
}
pub mod dr_key_intra_service_server {
#![allow(
unused_variables,
dead_code,
missing_docs,
clippy::wildcard_imports,
clippy::let_unit_value,
)]
use tonic::codegen::*;
#[async_trait]
pub trait DrKeyIntraService: std::marker::Send + std::marker::Sync + 'static {
async fn dr_key_intra_level1(
&self,
request: tonic::Request<super::DrKeyIntraLevel1Request>,
) -> std::result::Result<
tonic::Response<super::DrKeyIntraLevel1Response>,
tonic::Status,
>;
async fn dr_key_as_host(
&self,
request: tonic::Request<super::DrKeyAsHostRequest>,
) -> std::result::Result<
tonic::Response<super::DrKeyAsHostResponse>,
tonic::Status,
>;
async fn dr_key_host_as(
&self,
request: tonic::Request<super::DrKeyHostAsRequest>,
) -> std::result::Result<
tonic::Response<super::DrKeyHostAsResponse>,
tonic::Status,
>;
async fn dr_key_host_host(
&self,
request: tonic::Request<super::DrKeyHostHostRequest>,
) -> std::result::Result<
tonic::Response<super::DrKeyHostHostResponse>,
tonic::Status,
>;
async fn dr_key_secret_value(
&self,
request: tonic::Request<super::DrKeySecretValueRequest>,
) -> std::result::Result<
tonic::Response<super::DrKeySecretValueResponse>,
tonic::Status,
>;
}
#[derive(Debug)]
pub struct DrKeyIntraServiceServer<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> DrKeyIntraServiceServer<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 DrKeyIntraServiceServer<T>
where
T: DrKeyIntraService,
B: Body + std::marker::Send + 'static,
B::Error: Into<StdError> + std::marker::Send + 'static,
{
type Response = http::Response<tonic::body::BoxBody>;
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() {
"/proto.control_plane.v1.DRKeyIntraService/DRKeyIntraLevel1" => {
#[allow(non_camel_case_types)]
struct DRKeyIntraLevel1Svc<T: DrKeyIntraService>(pub Arc<T>);
impl<
T: DrKeyIntraService,
> tonic::server::UnaryService<super::DrKeyIntraLevel1Request>
for DRKeyIntraLevel1Svc<T> {
type Response = super::DrKeyIntraLevel1Response;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::DrKeyIntraLevel1Request>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as DrKeyIntraService>::dr_key_intra_level1(
&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 = DRKeyIntraLevel1Svc(inner);
let codec = tonic::codec::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)
}
"/proto.control_plane.v1.DRKeyIntraService/DRKeyASHost" => {
#[allow(non_camel_case_types)]
struct DRKeyASHostSvc<T: DrKeyIntraService>(pub Arc<T>);
impl<
T: DrKeyIntraService,
> tonic::server::UnaryService<super::DrKeyAsHostRequest>
for DRKeyASHostSvc<T> {
type Response = super::DrKeyAsHostResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::DrKeyAsHostRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as DrKeyIntraService>::dr_key_as_host(&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 = DRKeyASHostSvc(inner);
let codec = tonic::codec::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)
}
"/proto.control_plane.v1.DRKeyIntraService/DRKeyHostAS" => {
#[allow(non_camel_case_types)]
struct DRKeyHostASSvc<T: DrKeyIntraService>(pub Arc<T>);
impl<
T: DrKeyIntraService,
> tonic::server::UnaryService<super::DrKeyHostAsRequest>
for DRKeyHostASSvc<T> {
type Response = super::DrKeyHostAsResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::DrKeyHostAsRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as DrKeyIntraService>::dr_key_host_as(&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 = DRKeyHostASSvc(inner);
let codec = tonic::codec::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)
}
"/proto.control_plane.v1.DRKeyIntraService/DRKeyHostHost" => {
#[allow(non_camel_case_types)]
struct DRKeyHostHostSvc<T: DrKeyIntraService>(pub Arc<T>);
impl<
T: DrKeyIntraService,
> tonic::server::UnaryService<super::DrKeyHostHostRequest>
for DRKeyHostHostSvc<T> {
type Response = super::DrKeyHostHostResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::DrKeyHostHostRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as DrKeyIntraService>::dr_key_host_host(&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 = DRKeyHostHostSvc(inner);
let codec = tonic::codec::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)
}
"/proto.control_plane.v1.DRKeyIntraService/DRKeySecretValue" => {
#[allow(non_camel_case_types)]
struct DRKeySecretValueSvc<T: DrKeyIntraService>(pub Arc<T>);
impl<
T: DrKeyIntraService,
> tonic::server::UnaryService<super::DrKeySecretValueRequest>
for DRKeySecretValueSvc<T> {
type Response = super::DrKeySecretValueResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::DrKeySecretValueRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as DrKeyIntraService>::dr_key_secret_value(
&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 = DRKeySecretValueSvc(inner);
let codec = tonic::codec::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(empty_body());
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 DrKeyIntraServiceServer<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 = "proto.control_plane.v1.DRKeyIntraService";
impl<T> tonic::server::NamedService for DrKeyIntraServiceServer<T> {
const NAME: &'static str = SERVICE_NAME;
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ChainRenewalRequest {
#[prost(message, optional, tag = "1")]
pub signed_request: ::core::option::Option<super::super::crypto::v1::SignedMessage>,
#[prost(bytes = "vec", tag = "2")]
pub cms_signed_request: ::prost::alloc::vec::Vec<u8>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ChainRenewalRequestBody {
#[prost(bytes = "vec", tag = "1")]
pub csr: ::prost::alloc::vec::Vec<u8>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ChainRenewalResponse {
#[prost(message, optional, tag = "1")]
pub signed_response: ::core::option::Option<super::super::crypto::v1::SignedMessage>,
#[prost(bytes = "vec", tag = "2")]
pub cms_signed_response: ::prost::alloc::vec::Vec<u8>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ChainRenewalResponseBody {
#[prost(message, optional, tag = "1")]
pub chain: ::core::option::Option<Chain>,
}
pub mod chain_renewal_service_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 ChainRenewalServiceClient<T> {
inner: tonic::client::Grpc<T>,
}
impl ChainRenewalServiceClient<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> ChainRenewalServiceClient<T>
where
T: tonic::client::GrpcService<tonic::body::BoxBody>,
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,
) -> ChainRenewalServiceClient<InterceptedService<T, F>>
where
F: tonic::service::Interceptor,
T::ResponseBody: Default,
T: tonic::codegen::Service<
http::Request<tonic::body::BoxBody>,
Response = http::Response<
<T as tonic::client::GrpcService<tonic::body::BoxBody>>::ResponseBody,
>,
>,
<T as tonic::codegen::Service<
http::Request<tonic::body::BoxBody>,
>>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
{
ChainRenewalServiceClient::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 chain_renewal(
&mut self,
request: impl tonic::IntoRequest<super::ChainRenewalRequest>,
) -> std::result::Result<
tonic::Response<super::ChainRenewalResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/proto.control_plane.v1.ChainRenewalService/ChainRenewal",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"proto.control_plane.v1.ChainRenewalService",
"ChainRenewal",
),
);
self.inner.unary(req, path, codec).await
}
}
}
pub mod chain_renewal_service_server {
#![allow(
unused_variables,
dead_code,
missing_docs,
clippy::wildcard_imports,
clippy::let_unit_value,
)]
use tonic::codegen::*;
#[async_trait]
pub trait ChainRenewalService: std::marker::Send + std::marker::Sync + 'static {
async fn chain_renewal(
&self,
request: tonic::Request<super::ChainRenewalRequest>,
) -> std::result::Result<
tonic::Response<super::ChainRenewalResponse>,
tonic::Status,
>;
}
#[derive(Debug)]
pub struct ChainRenewalServiceServer<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> ChainRenewalServiceServer<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 ChainRenewalServiceServer<T>
where
T: ChainRenewalService,
B: Body + std::marker::Send + 'static,
B::Error: Into<StdError> + std::marker::Send + 'static,
{
type Response = http::Response<tonic::body::BoxBody>;
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() {
"/proto.control_plane.v1.ChainRenewalService/ChainRenewal" => {
#[allow(non_camel_case_types)]
struct ChainRenewalSvc<T: ChainRenewalService>(pub Arc<T>);
impl<
T: ChainRenewalService,
> tonic::server::UnaryService<super::ChainRenewalRequest>
for ChainRenewalSvc<T> {
type Response = super::ChainRenewalResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::ChainRenewalRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as ChainRenewalService>::chain_renewal(&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 = ChainRenewalSvc(inner);
let codec = tonic::codec::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(empty_body());
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 ChainRenewalServiceServer<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 = "proto.control_plane.v1.ChainRenewalService";
impl<T> tonic::server::NamedService for ChainRenewalServiceServer<T> {
const NAME: &'static str = SERVICE_NAME;
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct PathSegmentExtensions {
#[prost(message, optional, tag = "1")]
pub static_info: ::core::option::Option<StaticInfoExtension>,
#[prost(message, optional, tag = "2")]
pub hidden_path: ::core::option::Option<HiddenPathExtension>,
#[prost(message, optional, tag = "1000")]
pub digests: ::core::option::Option<DigestExtension>,
}
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct HiddenPathExtension {
#[prost(bool, tag = "1")]
pub is_hidden: bool,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct StaticInfoExtension {
#[prost(message, optional, tag = "1")]
pub latency: ::core::option::Option<LatencyInfo>,
#[prost(message, optional, tag = "2")]
pub bandwidth: ::core::option::Option<BandwidthInfo>,
#[prost(map = "uint64, message", tag = "3")]
pub geo: ::std::collections::HashMap<u64, GeoCoordinates>,
#[prost(map = "uint64, enumeration(LinkType)", tag = "4")]
pub link_type: ::std::collections::HashMap<u64, i32>,
#[prost(map = "uint64, uint32", tag = "5")]
pub internal_hops: ::std::collections::HashMap<u64, u32>,
#[prost(string, tag = "6")]
pub note: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct LatencyInfo {
#[prost(map = "uint64, uint32", tag = "1")]
pub intra: ::std::collections::HashMap<u64, u32>,
#[prost(map = "uint64, uint32", tag = "2")]
pub inter: ::std::collections::HashMap<u64, u32>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct BandwidthInfo {
#[prost(map = "uint64, uint64", tag = "1")]
pub intra: ::std::collections::HashMap<u64, u64>,
#[prost(map = "uint64, uint64", tag = "2")]
pub inter: ::std::collections::HashMap<u64, u64>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GeoCoordinates {
#[prost(float, tag = "1")]
pub latitude: f32,
#[prost(float, tag = "2")]
pub longitude: f32,
#[prost(string, tag = "3")]
pub address: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DigestExtension {
#[prost(message, optional, tag = "1000")]
pub epic: ::core::option::Option<digest_extension::Digest>,
}
pub mod digest_extension {
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Digest {
#[prost(bytes = "vec", tag = "1")]
pub digest: ::prost::alloc::vec::Vec<u8>,
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct PathSegmentUnsignedExtensions {
#[prost(message, optional, tag = "1000")]
pub epic: ::core::option::Option<super::experimental::v1::EpicDetachedExtension>,
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum LinkType {
Unspecified = 0,
Direct = 1,
MultiHop = 2,
OpenNet = 3,
}
impl LinkType {
pub fn as_str_name(&self) -> &'static str {
match self {
Self::Unspecified => "LINK_TYPE_UNSPECIFIED",
Self::Direct => "LINK_TYPE_DIRECT",
Self::MultiHop => "LINK_TYPE_MULTI_HOP",
Self::OpenNet => "LINK_TYPE_OPEN_NET",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"LINK_TYPE_UNSPECIFIED" => Some(Self::Unspecified),
"LINK_TYPE_DIRECT" => Some(Self::Direct),
"LINK_TYPE_MULTI_HOP" => Some(Self::MultiHop),
"LINK_TYPE_OPEN_NET" => Some(Self::OpenNet),
_ => None,
}
}
}
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct SegmentsRequest {
#[prost(uint64, tag = "1")]
pub src_isd_as: u64,
#[prost(uint64, tag = "2")]
pub dst_isd_as: u64,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SegmentsResponse {
#[prost(map = "int32, message", tag = "1")]
pub segments: ::std::collections::HashMap<i32, segments_response::Segments>,
#[prost(bytes = "vec", repeated, tag = "1000")]
pub deprecated_signed_revocations: ::prost::alloc::vec::Vec<
::prost::alloc::vec::Vec<u8>,
>,
}
pub mod segments_response {
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Segments {
#[prost(message, repeated, tag = "1")]
pub segments: ::prost::alloc::vec::Vec<super::PathSegment>,
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SegmentsRegistrationRequest {
#[prost(map = "int32, message", tag = "1")]
pub segments: ::std::collections::HashMap<
i32,
segments_registration_request::Segments,
>,
}
pub mod segments_registration_request {
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Segments {
#[prost(message, repeated, tag = "1")]
pub segments: ::prost::alloc::vec::Vec<super::PathSegment>,
}
}
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct SegmentsRegistrationResponse {}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct BeaconRequest {
#[prost(message, optional, tag = "1")]
pub segment: ::core::option::Option<PathSegment>,
}
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct BeaconResponse {}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct PathSegment {
#[prost(bytes = "vec", tag = "1")]
pub segment_info: ::prost::alloc::vec::Vec<u8>,
#[prost(message, repeated, tag = "2")]
pub as_entries: ::prost::alloc::vec::Vec<AsEntry>,
}
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct SegmentInformation {
#[prost(int64, tag = "1")]
pub timestamp: i64,
#[prost(uint32, tag = "2")]
pub segment_id: u32,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct AsEntry {
#[prost(message, optional, tag = "1")]
pub signed: ::core::option::Option<super::super::crypto::v1::SignedMessage>,
#[prost(message, optional, tag = "2")]
pub unsigned: ::core::option::Option<PathSegmentUnsignedExtensions>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct AsEntrySignedBody {
#[prost(uint64, tag = "1")]
pub isd_as: u64,
#[prost(uint64, tag = "2")]
pub next_isd_as: u64,
#[prost(message, optional, tag = "3")]
pub hop_entry: ::core::option::Option<HopEntry>,
#[prost(message, repeated, tag = "4")]
pub peer_entries: ::prost::alloc::vec::Vec<PeerEntry>,
#[prost(uint32, tag = "5")]
pub mtu: u32,
#[prost(message, optional, tag = "6")]
pub extensions: ::core::option::Option<PathSegmentExtensions>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct HopEntry {
#[prost(message, optional, tag = "1")]
pub hop_field: ::core::option::Option<HopField>,
#[prost(uint32, tag = "2")]
pub ingress_mtu: u32,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct PeerEntry {
#[prost(uint64, tag = "1")]
pub peer_isd_as: u64,
#[prost(uint64, tag = "2")]
pub peer_interface: u64,
#[prost(uint32, tag = "3")]
pub peer_mtu: u32,
#[prost(message, optional, tag = "4")]
pub hop_field: ::core::option::Option<HopField>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct HopField {
#[prost(uint64, tag = "1")]
pub ingress: u64,
#[prost(uint64, tag = "2")]
pub egress: u64,
#[prost(uint32, tag = "3")]
pub exp_time: u32,
#[prost(bytes = "vec", tag = "4")]
pub mac: ::prost::alloc::vec::Vec<u8>,
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum SegmentType {
Unspecified = 0,
Up = 1,
Down = 2,
Core = 3,
}
impl SegmentType {
pub fn as_str_name(&self) -> &'static str {
match self {
Self::Unspecified => "SEGMENT_TYPE_UNSPECIFIED",
Self::Up => "SEGMENT_TYPE_UP",
Self::Down => "SEGMENT_TYPE_DOWN",
Self::Core => "SEGMENT_TYPE_CORE",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"SEGMENT_TYPE_UNSPECIFIED" => Some(Self::Unspecified),
"SEGMENT_TYPE_UP" => Some(Self::Up),
"SEGMENT_TYPE_DOWN" => Some(Self::Down),
"SEGMENT_TYPE_CORE" => Some(Self::Core),
_ => None,
}
}
}
pub mod segment_lookup_service_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 SegmentLookupServiceClient<T> {
inner: tonic::client::Grpc<T>,
}
impl SegmentLookupServiceClient<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> SegmentLookupServiceClient<T>
where
T: tonic::client::GrpcService<tonic::body::BoxBody>,
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,
) -> SegmentLookupServiceClient<InterceptedService<T, F>>
where
F: tonic::service::Interceptor,
T::ResponseBody: Default,
T: tonic::codegen::Service<
http::Request<tonic::body::BoxBody>,
Response = http::Response<
<T as tonic::client::GrpcService<tonic::body::BoxBody>>::ResponseBody,
>,
>,
<T as tonic::codegen::Service<
http::Request<tonic::body::BoxBody>,
>>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
{
SegmentLookupServiceClient::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 segments(
&mut self,
request: impl tonic::IntoRequest<super::SegmentsRequest>,
) -> std::result::Result<
tonic::Response<super::SegmentsResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/proto.control_plane.v1.SegmentLookupService/Segments",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"proto.control_plane.v1.SegmentLookupService",
"Segments",
),
);
self.inner.unary(req, path, codec).await
}
}
}
pub mod segment_registration_service_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 SegmentRegistrationServiceClient<T> {
inner: tonic::client::Grpc<T>,
}
impl SegmentRegistrationServiceClient<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> SegmentRegistrationServiceClient<T>
where
T: tonic::client::GrpcService<tonic::body::BoxBody>,
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,
) -> SegmentRegistrationServiceClient<InterceptedService<T, F>>
where
F: tonic::service::Interceptor,
T::ResponseBody: Default,
T: tonic::codegen::Service<
http::Request<tonic::body::BoxBody>,
Response = http::Response<
<T as tonic::client::GrpcService<tonic::body::BoxBody>>::ResponseBody,
>,
>,
<T as tonic::codegen::Service<
http::Request<tonic::body::BoxBody>,
>>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
{
SegmentRegistrationServiceClient::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 segments_registration(
&mut self,
request: impl tonic::IntoRequest<super::SegmentsRegistrationRequest>,
) -> std::result::Result<
tonic::Response<super::SegmentsRegistrationResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/proto.control_plane.v1.SegmentRegistrationService/SegmentsRegistration",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"proto.control_plane.v1.SegmentRegistrationService",
"SegmentsRegistration",
),
);
self.inner.unary(req, path, codec).await
}
}
}
pub mod segment_creation_service_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 SegmentCreationServiceClient<T> {
inner: tonic::client::Grpc<T>,
}
impl SegmentCreationServiceClient<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> SegmentCreationServiceClient<T>
where
T: tonic::client::GrpcService<tonic::body::BoxBody>,
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,
) -> SegmentCreationServiceClient<InterceptedService<T, F>>
where
F: tonic::service::Interceptor,
T::ResponseBody: Default,
T: tonic::codegen::Service<
http::Request<tonic::body::BoxBody>,
Response = http::Response<
<T as tonic::client::GrpcService<tonic::body::BoxBody>>::ResponseBody,
>,
>,
<T as tonic::codegen::Service<
http::Request<tonic::body::BoxBody>,
>>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
{
SegmentCreationServiceClient::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 beacon(
&mut self,
request: impl tonic::IntoRequest<super::BeaconRequest>,
) -> std::result::Result<tonic::Response<super::BeaconResponse>, tonic::Status> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/proto.control_plane.v1.SegmentCreationService/Beacon",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"proto.control_plane.v1.SegmentCreationService",
"Beacon",
),
);
self.inner.unary(req, path, codec).await
}
}
}
pub mod segment_lookup_service_server {
#![allow(
unused_variables,
dead_code,
missing_docs,
clippy::wildcard_imports,
clippy::let_unit_value,
)]
use tonic::codegen::*;
#[async_trait]
pub trait SegmentLookupService: std::marker::Send + std::marker::Sync + 'static {
async fn segments(
&self,
request: tonic::Request<super::SegmentsRequest>,
) -> std::result::Result<
tonic::Response<super::SegmentsResponse>,
tonic::Status,
>;
}
#[derive(Debug)]
pub struct SegmentLookupServiceServer<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> SegmentLookupServiceServer<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 SegmentLookupServiceServer<T>
where
T: SegmentLookupService,
B: Body + std::marker::Send + 'static,
B::Error: Into<StdError> + std::marker::Send + 'static,
{
type Response = http::Response<tonic::body::BoxBody>;
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() {
"/proto.control_plane.v1.SegmentLookupService/Segments" => {
#[allow(non_camel_case_types)]
struct SegmentsSvc<T: SegmentLookupService>(pub Arc<T>);
impl<
T: SegmentLookupService,
> tonic::server::UnaryService<super::SegmentsRequest>
for SegmentsSvc<T> {
type Response = super::SegmentsResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::SegmentsRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as SegmentLookupService>::segments(&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 = SegmentsSvc(inner);
let codec = tonic::codec::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(empty_body());
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 SegmentLookupServiceServer<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 = "proto.control_plane.v1.SegmentLookupService";
impl<T> tonic::server::NamedService for SegmentLookupServiceServer<T> {
const NAME: &'static str = SERVICE_NAME;
}
}
pub mod segment_registration_service_server {
#![allow(
unused_variables,
dead_code,
missing_docs,
clippy::wildcard_imports,
clippy::let_unit_value,
)]
use tonic::codegen::*;
#[async_trait]
pub trait SegmentRegistrationService: std::marker::Send + std::marker::Sync + 'static {
async fn segments_registration(
&self,
request: tonic::Request<super::SegmentsRegistrationRequest>,
) -> std::result::Result<
tonic::Response<super::SegmentsRegistrationResponse>,
tonic::Status,
>;
}
#[derive(Debug)]
pub struct SegmentRegistrationServiceServer<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> SegmentRegistrationServiceServer<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 SegmentRegistrationServiceServer<T>
where
T: SegmentRegistrationService,
B: Body + std::marker::Send + 'static,
B::Error: Into<StdError> + std::marker::Send + 'static,
{
type Response = http::Response<tonic::body::BoxBody>;
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() {
"/proto.control_plane.v1.SegmentRegistrationService/SegmentsRegistration" => {
#[allow(non_camel_case_types)]
struct SegmentsRegistrationSvc<T: SegmentRegistrationService>(
pub Arc<T>,
);
impl<
T: SegmentRegistrationService,
> tonic::server::UnaryService<super::SegmentsRegistrationRequest>
for SegmentsRegistrationSvc<T> {
type Response = super::SegmentsRegistrationResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::SegmentsRegistrationRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as SegmentRegistrationService>::segments_registration(
&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 = SegmentsRegistrationSvc(inner);
let codec = tonic::codec::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(empty_body());
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 SegmentRegistrationServiceServer<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 = "proto.control_plane.v1.SegmentRegistrationService";
impl<T> tonic::server::NamedService for SegmentRegistrationServiceServer<T> {
const NAME: &'static str = SERVICE_NAME;
}
}
pub mod segment_creation_service_server {
#![allow(
unused_variables,
dead_code,
missing_docs,
clippy::wildcard_imports,
clippy::let_unit_value,
)]
use tonic::codegen::*;
#[async_trait]
pub trait SegmentCreationService: std::marker::Send + std::marker::Sync + 'static {
async fn beacon(
&self,
request: tonic::Request<super::BeaconRequest>,
) -> std::result::Result<tonic::Response<super::BeaconResponse>, tonic::Status>;
}
#[derive(Debug)]
pub struct SegmentCreationServiceServer<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> SegmentCreationServiceServer<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 SegmentCreationServiceServer<T>
where
T: SegmentCreationService,
B: Body + std::marker::Send + 'static,
B::Error: Into<StdError> + std::marker::Send + 'static,
{
type Response = http::Response<tonic::body::BoxBody>;
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() {
"/proto.control_plane.v1.SegmentCreationService/Beacon" => {
#[allow(non_camel_case_types)]
struct BeaconSvc<T: SegmentCreationService>(pub Arc<T>);
impl<
T: SegmentCreationService,
> tonic::server::UnaryService<super::BeaconRequest>
for BeaconSvc<T> {
type Response = super::BeaconResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::BeaconRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as SegmentCreationService>::beacon(&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 = BeaconSvc(inner);
let codec = tonic::codec::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(empty_body());
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 SegmentCreationServiceServer<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 = "proto.control_plane.v1.SegmentCreationService";
impl<T> tonic::server::NamedService for SegmentCreationServiceServer<T> {
const NAME: &'static str = SERVICE_NAME;
}
}
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct ServiceResolutionRequest {}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ServiceResolutionResponse {
#[prost(map = "string, message", tag = "1")]
pub transports: ::std::collections::HashMap<
::prost::alloc::string::String,
Transport,
>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Transport {
#[prost(string, tag = "1")]
pub address: ::prost::alloc::string::String,
}