pub type OwnedGetDepositWithdrawConfigRequestView = ::buffa::view::OwnedView<
crate::proto::chain::zipper::v1::__buffa::view::GetDepositWithdrawConfigRequestView<
'static,
>,
>;
pub type OwnedGetDepositWithdrawConfigResponseView = ::buffa::view::OwnedView<
crate::proto::chain::zipper::v1::__buffa::view::GetDepositWithdrawConfigResponseView<
'static,
>,
>;
impl ::connectrpc::Encodable<
crate::proto::chain::zipper::v1::GetDepositWithdrawConfigResponse,
>
for crate::proto::chain::zipper::v1::__buffa::view::GetDepositWithdrawConfigResponseView<
'_,
> {
fn encode(
&self,
codec: ::connectrpc::CodecFormat,
) -> ::std::result::Result<::buffa::bytes::Bytes, ::connectrpc::ConnectError> {
::connectrpc::__codegen::encode_view_body(self, codec)
}
}
impl ::connectrpc::Encodable<
crate::proto::chain::zipper::v1::GetDepositWithdrawConfigResponse,
>
for ::buffa::view::OwnedView<
crate::proto::chain::zipper::v1::__buffa::view::GetDepositWithdrawConfigResponseView<
'static,
>,
> {
fn encode(
&self,
codec: ::connectrpc::CodecFormat,
) -> ::std::result::Result<::buffa::bytes::Bytes, ::connectrpc::ConnectError> {
::connectrpc::__codegen::encode_view_body(self.reborrow(), codec)
}
}
pub const ZIPPER_SERVICE_SERVICE_NAME: &str = "chain.zipper.v1.ZipperService";
pub const ZIPPER_SERVICE_GET_DEPOSIT_WITHDRAW_CONFIG_SPEC: ::connectrpc::Spec = ::connectrpc::Spec::server(
"/chain.zipper.v1.ZipperService/GetDepositWithdrawConfig",
::connectrpc::StreamType::Unary,
)
.with_idempotency_level(::connectrpc::IdempotencyLevel::Unknown);
#[allow(clippy::type_complexity)]
pub trait ZipperService: Send + Sync + 'static {
fn get_deposit_withdraw_config<'a>(
&'a self,
ctx: ::connectrpc::RequestContext,
request: ::connectrpc::ServiceRequest<
'_,
crate::proto::chain::zipper::v1::GetDepositWithdrawConfigRequest,
>,
) -> impl ::std::future::Future<
Output = ::connectrpc::ServiceResult<
impl ::connectrpc::Encodable<
crate::proto::chain::zipper::v1::GetDepositWithdrawConfigResponse,
> + Send + use<'a, Self>,
>,
> + Send;
}
pub trait ZipperServiceExt: ZipperService {
fn register(
self: ::std::sync::Arc<Self>,
router: ::connectrpc::Router,
) -> ::connectrpc::Router;
}
impl<S: ZipperService> ZipperServiceExt for S {
fn register(
self: ::std::sync::Arc<Self>,
router: ::connectrpc::Router,
) -> ::connectrpc::Router {
router
.route_view(
ZIPPER_SERVICE_SERVICE_NAME,
"GetDepositWithdrawConfig",
{
let svc = ::std::sync::Arc::clone(&self);
::connectrpc::view_handler_fn(move |
ctx,
req: ::buffa::view::OwnedView<
crate::proto::chain::zipper::v1::__buffa::view::GetDepositWithdrawConfigRequestView<
'static,
>,
>,
format|
{
let svc = ::std::sync::Arc::clone(&svc);
async move {
let sreq = ::connectrpc::ServiceRequest::<
crate::proto::chain::zipper::v1::GetDepositWithdrawConfigRequest,
>::from_parts(req.reborrow(), req.bytes());
svc.get_deposit_withdraw_config(ctx, sreq)
.await?
.encode::<
crate::proto::chain::zipper::v1::GetDepositWithdrawConfigResponse,
>(format)
}
})
},
)
.with_spec(ZIPPER_SERVICE_GET_DEPOSIT_WITHDRAW_CONFIG_SPEC)
}
}
#[doc(hidden)]
pub struct ZipperServiceRegisterMarker;
impl<S: ZipperService> ::connectrpc::ServiceRegister<ZipperServiceRegisterMarker>
for ::std::sync::Arc<S> {
fn register_service(self, router: ::connectrpc::Router) -> ::connectrpc::Router {
<S as ZipperServiceExt>::register(self, router)
}
}
pub struct ZipperServiceServer<T> {
inner: ::std::sync::Arc<T>,
}
impl<T: ZipperService> ZipperServiceServer<T> {
pub fn new(service: T) -> Self {
Self {
inner: ::std::sync::Arc::new(service),
}
}
pub fn from_arc(inner: ::std::sync::Arc<T>) -> Self {
Self { inner }
}
}
impl<T> Clone for ZipperServiceServer<T> {
fn clone(&self) -> Self {
Self {
inner: ::std::sync::Arc::clone(&self.inner),
}
}
}
impl<T: ZipperService> ::connectrpc::Dispatcher for ZipperServiceServer<T> {
#[inline]
fn lookup(
&self,
path: &str,
) -> Option<::connectrpc::dispatcher::codegen::MethodDescriptor> {
let method = path.strip_prefix("chain.zipper.v1.ZipperService/")?;
match method {
"GetDepositWithdrawConfig" => {
Some(
::connectrpc::dispatcher::codegen::MethodDescriptor::unary(false)
.with_spec(ZIPPER_SERVICE_GET_DEPOSIT_WITHDRAW_CONFIG_SPEC),
)
}
_ => None,
}
}
fn call_unary(
&self,
path: &str,
ctx: ::connectrpc::RequestContext,
request: ::connectrpc::Payload,
format: ::connectrpc::CodecFormat,
) -> ::connectrpc::dispatcher::codegen::UnaryResult {
let Some(method) = path.strip_prefix("chain.zipper.v1.ZipperService/") else {
return ::connectrpc::dispatcher::codegen::unimplemented_unary(path);
};
let _ = (&ctx, &request, &format);
match method {
"GetDepositWithdrawConfig" => {
let svc = ::std::sync::Arc::clone(&self.inner);
Box::pin(async move {
let body = ::connectrpc::dispatcher::codegen::request_proto_bytes::<
crate::proto::chain::zipper::v1::GetDepositWithdrawConfigRequest,
>(request.encoded()?, format)?;
let req: crate::proto::chain::zipper::v1::__buffa::view::GetDepositWithdrawConfigRequestView<
'_,
> = ::connectrpc::dispatcher::codegen::decode_borrowed_request_view(
&body,
)?;
let req = ::connectrpc::ServiceRequest::<
crate::proto::chain::zipper::v1::GetDepositWithdrawConfigRequest,
>::from_parts(&req, &body);
svc.get_deposit_withdraw_config(ctx, req)
.await?
.encode::<
crate::proto::chain::zipper::v1::GetDepositWithdrawConfigResponse,
>(format)
})
}
_ => ::connectrpc::dispatcher::codegen::unimplemented_unary(path),
}
}
fn call_server_streaming(
&self,
path: &str,
ctx: ::connectrpc::RequestContext,
request: ::buffa::bytes::Bytes,
format: ::connectrpc::CodecFormat,
) -> ::connectrpc::dispatcher::codegen::StreamingResult {
let Some(method) = path.strip_prefix("chain.zipper.v1.ZipperService/") else {
return ::connectrpc::dispatcher::codegen::unimplemented_streaming(path);
};
let _ = (&ctx, &request, &format);
match method {
_ => ::connectrpc::dispatcher::codegen::unimplemented_streaming(path),
}
}
fn call_client_streaming(
&self,
path: &str,
ctx: ::connectrpc::RequestContext,
requests: ::connectrpc::dispatcher::codegen::RequestStream,
format: ::connectrpc::CodecFormat,
) -> ::connectrpc::dispatcher::codegen::UnaryResult {
let Some(method) = path.strip_prefix("chain.zipper.v1.ZipperService/") else {
return ::connectrpc::dispatcher::codegen::unimplemented_unary(path);
};
let _ = (&ctx, &requests, &format);
match method {
_ => ::connectrpc::dispatcher::codegen::unimplemented_unary(path),
}
}
fn call_bidi_streaming(
&self,
path: &str,
ctx: ::connectrpc::RequestContext,
requests: ::connectrpc::dispatcher::codegen::RequestStream,
format: ::connectrpc::CodecFormat,
) -> ::connectrpc::dispatcher::codegen::StreamingResult {
let Some(method) = path.strip_prefix("chain.zipper.v1.ZipperService/") else {
return ::connectrpc::dispatcher::codegen::unimplemented_streaming(path);
};
let _ = (&ctx, &requests, &format);
match method {
_ => ::connectrpc::dispatcher::codegen::unimplemented_streaming(path),
}
}
}
#[derive(Clone)]
pub struct ZipperServiceClient<T> {
transport: T,
config: ::connectrpc::client::ClientConfig,
}
impl<T> ZipperServiceClient<T>
where
T: ::connectrpc::client::ClientTransport,
<T::ResponseBody as ::connectrpc::http_body::Body>::Error: ::std::fmt::Display,
{
pub fn new(transport: T, config: ::connectrpc::client::ClientConfig) -> Self {
Self { transport, config }
}
pub fn config(&self) -> &::connectrpc::client::ClientConfig {
&self.config
}
pub fn config_mut(&mut self) -> &mut ::connectrpc::client::ClientConfig {
&mut self.config
}
pub async fn get_deposit_withdraw_config(
&self,
request: crate::proto::chain::zipper::v1::GetDepositWithdrawConfigRequest,
) -> Result<
::connectrpc::client::UnaryResponse<
::buffa::view::OwnedView<
crate::proto::chain::zipper::v1::__buffa::view::GetDepositWithdrawConfigResponseView<
'static,
>,
>,
>,
::connectrpc::ConnectError,
> {
self.get_deposit_withdraw_config_with_options(
request,
::connectrpc::client::CallOptions::default(),
)
.await
}
pub async fn get_deposit_withdraw_config_with_options(
&self,
request: crate::proto::chain::zipper::v1::GetDepositWithdrawConfigRequest,
options: ::connectrpc::client::CallOptions,
) -> Result<
::connectrpc::client::UnaryResponse<
::buffa::view::OwnedView<
crate::proto::chain::zipper::v1::__buffa::view::GetDepositWithdrawConfigResponseView<
'static,
>,
>,
>,
::connectrpc::ConnectError,
> {
::connectrpc::client::call_unary(
&self.transport,
&self.config,
ZIPPER_SERVICE_SERVICE_NAME,
"GetDepositWithdrawConfig",
request,
options,
)
.await
}
}