pub type OwnedIngestEventRequestView = ::buffa::view::OwnedView<
crate::proto::lineage::v1::__buffa::view::IngestEventRequestView<'static>,
>;
pub type OwnedIngestEventResponseView = ::buffa::view::OwnedView<
crate::proto::lineage::v1::__buffa::view::IngestEventResponseView<'static>,
>;
pub type OwnedIngestBatchRequestView = ::buffa::view::OwnedView<
crate::proto::lineage::v1::__buffa::view::IngestBatchRequestView<'static>,
>;
pub type OwnedIngestBatchResponseView = ::buffa::view::OwnedView<
crate::proto::lineage::v1::__buffa::view::IngestBatchResponseView<'static>,
>;
impl ::connectrpc::Encodable<crate::proto::lineage::v1::IngestEventResponse>
for crate::proto::lineage::v1::__buffa::view::IngestEventResponseView<'_> {
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::lineage::v1::IngestEventResponse>
for ::buffa::view::OwnedView<
crate::proto::lineage::v1::__buffa::view::IngestEventResponseView<'static>,
> {
fn encode(
&self,
codec: ::connectrpc::CodecFormat,
) -> ::std::result::Result<::buffa::bytes::Bytes, ::connectrpc::ConnectError> {
::connectrpc::__codegen::encode_view_body(self.reborrow(), codec)
}
}
impl ::connectrpc::Encodable<crate::proto::lineage::v1::IngestBatchResponse>
for crate::proto::lineage::v1::__buffa::view::IngestBatchResponseView<'_> {
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::lineage::v1::IngestBatchResponse>
for ::buffa::view::OwnedView<
crate::proto::lineage::v1::__buffa::view::IngestBatchResponseView<'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 INGEST_SERVICE_SERVICE_NAME: &str = "lineage.v1.IngestService";
pub const INGEST_SERVICE_INGEST_EVENT_SPEC: ::connectrpc::Spec = ::connectrpc::Spec::server(
"/lineage.v1.IngestService/IngestEvent",
::connectrpc::StreamType::Unary,
)
.with_idempotency_level(::connectrpc::IdempotencyLevel::Unknown);
pub const INGEST_SERVICE_INGEST_BATCH_SPEC: ::connectrpc::Spec = ::connectrpc::Spec::server(
"/lineage.v1.IngestService/IngestBatch",
::connectrpc::StreamType::Unary,
)
.with_idempotency_level(::connectrpc::IdempotencyLevel::Unknown);
#[allow(clippy::type_complexity)]
pub trait IngestService: Send + Sync + 'static {
fn ingest_event<'a>(
&'a self,
ctx: ::connectrpc::RequestContext,
request: ::connectrpc::ServiceRequest<
'_,
crate::proto::lineage::v1::IngestEventRequest,
>,
) -> impl ::std::future::Future<
Output = ::connectrpc::ServiceResult<
impl ::connectrpc::Encodable<
crate::proto::lineage::v1::IngestEventResponse,
> + Send + use<'a, Self>,
>,
> + Send;
fn ingest_batch<'a>(
&'a self,
ctx: ::connectrpc::RequestContext,
request: ::connectrpc::ServiceRequest<
'_,
crate::proto::lineage::v1::IngestBatchRequest,
>,
) -> impl ::std::future::Future<
Output = ::connectrpc::ServiceResult<
impl ::connectrpc::Encodable<
crate::proto::lineage::v1::IngestBatchResponse,
> + Send + use<'a, Self>,
>,
> + Send;
}
pub trait IngestServiceExt: IngestService {
fn register(
self: ::std::sync::Arc<Self>,
router: ::connectrpc::Router,
) -> ::connectrpc::Router;
}
impl<S: IngestService> IngestServiceExt for S {
fn register(
self: ::std::sync::Arc<Self>,
router: ::connectrpc::Router,
) -> ::connectrpc::Router {
router
.route_view(
INGEST_SERVICE_SERVICE_NAME,
"IngestEvent",
{
let svc = ::std::sync::Arc::clone(&self);
::connectrpc::view_handler_fn(move |
ctx,
req: ::buffa::view::OwnedView<
crate::proto::lineage::v1::__buffa::view::IngestEventRequestView<
'static,
>,
>,
format|
{
let svc = ::std::sync::Arc::clone(&svc);
async move {
let sreq = ::connectrpc::ServiceRequest::<
crate::proto::lineage::v1::IngestEventRequest,
>::from_parts(req.reborrow(), req.bytes());
svc.ingest_event(ctx, sreq)
.await?
.encode::<
crate::proto::lineage::v1::IngestEventResponse,
>(format)
}
})
},
)
.with_spec(INGEST_SERVICE_INGEST_EVENT_SPEC)
.route_view(
INGEST_SERVICE_SERVICE_NAME,
"IngestBatch",
{
let svc = ::std::sync::Arc::clone(&self);
::connectrpc::view_handler_fn(move |
ctx,
req: ::buffa::view::OwnedView<
crate::proto::lineage::v1::__buffa::view::IngestBatchRequestView<
'static,
>,
>,
format|
{
let svc = ::std::sync::Arc::clone(&svc);
async move {
let sreq = ::connectrpc::ServiceRequest::<
crate::proto::lineage::v1::IngestBatchRequest,
>::from_parts(req.reborrow(), req.bytes());
svc.ingest_batch(ctx, sreq)
.await?
.encode::<
crate::proto::lineage::v1::IngestBatchResponse,
>(format)
}
})
},
)
.with_spec(INGEST_SERVICE_INGEST_BATCH_SPEC)
}
}
pub struct IngestServiceServer<T> {
inner: ::std::sync::Arc<T>,
}
impl<T: IngestService> IngestServiceServer<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 IngestServiceServer<T> {
fn clone(&self) -> Self {
Self {
inner: ::std::sync::Arc::clone(&self.inner),
}
}
}
impl<T: IngestService> ::connectrpc::Dispatcher for IngestServiceServer<T> {
#[inline]
fn lookup(
&self,
path: &str,
) -> Option<::connectrpc::dispatcher::codegen::MethodDescriptor> {
let method = path.strip_prefix("lineage.v1.IngestService/")?;
match method {
"IngestEvent" => {
Some(
::connectrpc::dispatcher::codegen::MethodDescriptor::unary(false)
.with_spec(INGEST_SERVICE_INGEST_EVENT_SPEC),
)
}
"IngestBatch" => {
Some(
::connectrpc::dispatcher::codegen::MethodDescriptor::unary(false)
.with_spec(INGEST_SERVICE_INGEST_BATCH_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("lineage.v1.IngestService/") else {
return ::connectrpc::dispatcher::codegen::unimplemented_unary(path);
};
let _ = (&ctx, &request, &format);
match method {
"IngestEvent" => {
let svc = ::std::sync::Arc::clone(&self.inner);
Box::pin(async move {
let body = ::connectrpc::dispatcher::codegen::request_proto_bytes::<
crate::proto::lineage::v1::IngestEventRequest,
>(request.encoded()?, format)?;
let req: crate::proto::lineage::v1::__buffa::view::IngestEventRequestView<
'_,
> = ::connectrpc::dispatcher::codegen::decode_borrowed_request_view(
&body,
)?;
let req = ::connectrpc::ServiceRequest::<
crate::proto::lineage::v1::IngestEventRequest,
>::from_parts(&req, &body);
svc.ingest_event(ctx, req)
.await?
.encode::<crate::proto::lineage::v1::IngestEventResponse>(format)
})
}
"IngestBatch" => {
let svc = ::std::sync::Arc::clone(&self.inner);
Box::pin(async move {
let body = ::connectrpc::dispatcher::codegen::request_proto_bytes::<
crate::proto::lineage::v1::IngestBatchRequest,
>(request.encoded()?, format)?;
let req: crate::proto::lineage::v1::__buffa::view::IngestBatchRequestView<
'_,
> = ::connectrpc::dispatcher::codegen::decode_borrowed_request_view(
&body,
)?;
let req = ::connectrpc::ServiceRequest::<
crate::proto::lineage::v1::IngestBatchRequest,
>::from_parts(&req, &body);
svc.ingest_batch(ctx, req)
.await?
.encode::<crate::proto::lineage::v1::IngestBatchResponse>(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("lineage.v1.IngestService/") 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("lineage.v1.IngestService/") 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("lineage.v1.IngestService/") else {
return ::connectrpc::dispatcher::codegen::unimplemented_streaming(path);
};
let _ = (&ctx, &requests, &format);
match method {
_ => ::connectrpc::dispatcher::codegen::unimplemented_streaming(path),
}
}
}
#[derive(Clone)]
pub struct IngestServiceClient<T> {
transport: T,
config: ::connectrpc::client::ClientConfig,
}
impl<T> IngestServiceClient<T>
where
T: ::connectrpc::client::ClientTransport,
<T::ResponseBody as ::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 ingest_event(
&self,
request: crate::proto::lineage::v1::IngestEventRequest,
) -> Result<
::connectrpc::client::UnaryResponse<
::buffa::view::OwnedView<
crate::proto::lineage::v1::__buffa::view::IngestEventResponseView<
'static,
>,
>,
>,
::connectrpc::ConnectError,
> {
self.ingest_event_with_options(
request,
::connectrpc::client::CallOptions::default(),
)
.await
}
pub async fn ingest_event_with_options(
&self,
request: crate::proto::lineage::v1::IngestEventRequest,
options: ::connectrpc::client::CallOptions,
) -> Result<
::connectrpc::client::UnaryResponse<
::buffa::view::OwnedView<
crate::proto::lineage::v1::__buffa::view::IngestEventResponseView<
'static,
>,
>,
>,
::connectrpc::ConnectError,
> {
::connectrpc::client::call_unary(
&self.transport,
&self.config,
INGEST_SERVICE_SERVICE_NAME,
"IngestEvent",
request,
options,
)
.await
}
pub async fn ingest_batch(
&self,
request: crate::proto::lineage::v1::IngestBatchRequest,
) -> Result<
::connectrpc::client::UnaryResponse<
::buffa::view::OwnedView<
crate::proto::lineage::v1::__buffa::view::IngestBatchResponseView<
'static,
>,
>,
>,
::connectrpc::ConnectError,
> {
self.ingest_batch_with_options(
request,
::connectrpc::client::CallOptions::default(),
)
.await
}
pub async fn ingest_batch_with_options(
&self,
request: crate::proto::lineage::v1::IngestBatchRequest,
options: ::connectrpc::client::CallOptions,
) -> Result<
::connectrpc::client::UnaryResponse<
::buffa::view::OwnedView<
crate::proto::lineage::v1::__buffa::view::IngestBatchResponseView<
'static,
>,
>,
>,
::connectrpc::ConnectError,
> {
::connectrpc::client::call_unary(
&self.transport,
&self.config,
INGEST_SERVICE_SERVICE_NAME,
"IngestBatch",
request,
options,
)
.await
}
}