#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Uuid {
#[prost(bytes = "vec", tag = "1")]
pub value: ::prost::alloc::vec::Vec<u8>,
}
impl ::prost::Name for Uuid {
const NAME: &'static str = "UUID";
const PACKAGE: &'static str = "angzarr";
fn full_name() -> ::prost::alloc::string::String {
"angzarr.UUID".into()
}
fn type_url() -> ::prost::alloc::string::String {
"/angzarr.UUID".into()
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Cover {
#[prost(string, tag = "2")]
pub domain: ::prost::alloc::string::String,
#[prost(message, optional, tag = "1")]
pub root: ::core::option::Option<Uuid>,
#[prost(string, tag = "3")]
pub correlation_id: ::prost::alloc::string::String,
#[prost(message, optional, tag = "4")]
pub edition: ::core::option::Option<Edition>,
}
impl ::prost::Name for Cover {
const NAME: &'static str = "Cover";
const PACKAGE: &'static str = "angzarr";
fn full_name() -> ::prost::alloc::string::String {
"angzarr.Cover".into()
}
fn type_url() -> ::prost::alloc::string::String {
"/angzarr.Cover".into()
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Edition {
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
#[prost(message, repeated, tag = "2")]
pub divergences: ::prost::alloc::vec::Vec<DomainDivergence>,
}
impl ::prost::Name for Edition {
const NAME: &'static str = "Edition";
const PACKAGE: &'static str = "angzarr";
fn full_name() -> ::prost::alloc::string::String {
"angzarr.Edition".into()
}
fn type_url() -> ::prost::alloc::string::String {
"/angzarr.Edition".into()
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DomainDivergence {
#[prost(string, tag = "1")]
pub domain: ::prost::alloc::string::String,
#[prost(uint32, tag = "2")]
pub sequence: u32,
}
impl ::prost::Name for DomainDivergence {
const NAME: &'static str = "DomainDivergence";
const PACKAGE: &'static str = "angzarr";
fn full_name() -> ::prost::alloc::string::String {
"angzarr.DomainDivergence".into()
}
fn type_url() -> ::prost::alloc::string::String {
"/angzarr.DomainDivergence".into()
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct PayloadReference {
#[prost(enumeration = "PayloadStorageType", tag = "1")]
pub storage_type: i32,
#[prost(string, tag = "2")]
pub uri: ::prost::alloc::string::String,
#[prost(bytes = "vec", tag = "3")]
pub content_hash: ::prost::alloc::vec::Vec<u8>,
#[prost(uint64, tag = "4")]
pub original_size: u64,
#[prost(message, optional, tag = "5")]
pub stored_at: ::core::option::Option<::prost_types::Timestamp>,
}
impl ::prost::Name for PayloadReference {
const NAME: &'static str = "PayloadReference";
const PACKAGE: &'static str = "angzarr";
fn full_name() -> ::prost::alloc::string::String {
"angzarr.PayloadReference".into()
}
fn type_url() -> ::prost::alloc::string::String {
"/angzarr.PayloadReference".into()
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct PageHeader {
#[prost(oneof = "page_header::SequenceType", tags = "1, 2, 3")]
pub sequence_type: ::core::option::Option<page_header::SequenceType>,
}
pub mod page_header {
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum SequenceType {
#[prost(uint32, tag = "1")]
Sequence(u32),
#[prost(message, tag = "2")]
ExternalDeferred(super::ExternalDeferredSequence),
#[prost(message, tag = "3")]
AngzarrDeferred(super::AngzarrDeferredSequence),
}
}
impl ::prost::Name for PageHeader {
const NAME: &'static str = "PageHeader";
const PACKAGE: &'static str = "angzarr";
fn full_name() -> ::prost::alloc::string::String {
"angzarr.PageHeader".into()
}
fn type_url() -> ::prost::alloc::string::String {
"/angzarr.PageHeader".into()
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ExternalDeferredSequence {
#[prost(string, tag = "1")]
pub external_id: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub description: ::prost::alloc::string::String,
}
impl ::prost::Name for ExternalDeferredSequence {
const NAME: &'static str = "ExternalDeferredSequence";
const PACKAGE: &'static str = "angzarr";
fn full_name() -> ::prost::alloc::string::String {
"angzarr.ExternalDeferredSequence".into()
}
fn type_url() -> ::prost::alloc::string::String {
"/angzarr.ExternalDeferredSequence".into()
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct AngzarrDeferredSequence {
#[prost(message, optional, tag = "1")]
pub source: ::core::option::Option<Cover>,
#[prost(uint32, tag = "2")]
pub source_seq: u32,
}
impl ::prost::Name for AngzarrDeferredSequence {
const NAME: &'static str = "AngzarrDeferredSequence";
const PACKAGE: &'static str = "angzarr";
fn full_name() -> ::prost::alloc::string::String {
"angzarr.AngzarrDeferredSequence".into()
}
fn type_url() -> ::prost::alloc::string::String {
"/angzarr.AngzarrDeferredSequence".into()
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct EventPage {
#[prost(message, optional, tag = "1")]
pub header: ::core::option::Option<PageHeader>,
#[prost(message, optional, tag = "2")]
pub created_at: ::core::option::Option<::prost_types::Timestamp>,
#[prost(oneof = "event_page::Payload", tags = "3, 4")]
pub payload: ::core::option::Option<event_page::Payload>,
}
pub mod event_page {
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum Payload {
#[prost(message, tag = "3")]
Event(::prost_types::Any),
#[prost(message, tag = "4")]
External(super::PayloadReference),
}
}
impl ::prost::Name for EventPage {
const NAME: &'static str = "EventPage";
const PACKAGE: &'static str = "angzarr";
fn full_name() -> ::prost::alloc::string::String {
"angzarr.EventPage".into()
}
fn type_url() -> ::prost::alloc::string::String {
"/angzarr.EventPage".into()
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Snapshot {
#[prost(uint32, tag = "2")]
pub sequence: u32,
#[prost(message, optional, tag = "3")]
pub state: ::core::option::Option<::prost_types::Any>,
#[prost(enumeration = "SnapshotRetention", tag = "4")]
pub retention: i32,
}
impl ::prost::Name for Snapshot {
const NAME: &'static str = "Snapshot";
const PACKAGE: &'static str = "angzarr";
fn full_name() -> ::prost::alloc::string::String {
"angzarr.Snapshot".into()
}
fn type_url() -> ::prost::alloc::string::String {
"/angzarr.Snapshot".into()
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct EventBook {
#[prost(message, optional, tag = "1")]
pub cover: ::core::option::Option<Cover>,
#[prost(message, optional, tag = "2")]
pub snapshot: ::core::option::Option<Snapshot>,
#[prost(message, repeated, tag = "3")]
pub pages: ::prost::alloc::vec::Vec<EventPage>,
#[prost(uint32, tag = "6")]
pub next_sequence: u32,
}
impl ::prost::Name for EventBook {
const NAME: &'static str = "EventBook";
const PACKAGE: &'static str = "angzarr";
fn full_name() -> ::prost::alloc::string::String {
"angzarr.EventBook".into()
}
fn type_url() -> ::prost::alloc::string::String {
"/angzarr.EventBook".into()
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct EventRequest {
#[prost(message, optional, tag = "1")]
pub events: ::core::option::Option<EventBook>,
#[prost(enumeration = "SyncMode", tag = "2")]
pub sync_mode: i32,
#[prost(bool, tag = "3")]
pub route_to_handler: bool,
}
impl ::prost::Name for EventRequest {
const NAME: &'static str = "EventRequest";
const PACKAGE: &'static str = "angzarr";
fn full_name() -> ::prost::alloc::string::String {
"angzarr.EventRequest".into()
}
fn type_url() -> ::prost::alloc::string::String {
"/angzarr.EventRequest".into()
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Projection {
#[prost(message, optional, tag = "1")]
pub cover: ::core::option::Option<Cover>,
#[prost(string, tag = "2")]
pub projector: ::prost::alloc::string::String,
#[prost(uint32, tag = "3")]
pub sequence: u32,
#[prost(message, optional, tag = "4")]
pub projection: ::core::option::Option<::prost_types::Any>,
}
impl ::prost::Name for Projection {
const NAME: &'static str = "Projection";
const PACKAGE: &'static str = "angzarr";
fn full_name() -> ::prost::alloc::string::String {
"angzarr.Projection".into()
}
fn type_url() -> ::prost::alloc::string::String {
"/angzarr.Projection".into()
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CommandPage {
#[prost(message, optional, tag = "1")]
pub header: ::core::option::Option<PageHeader>,
#[prost(enumeration = "MergeStrategy", tag = "2")]
pub merge_strategy: i32,
#[prost(oneof = "command_page::Payload", tags = "3, 4")]
pub payload: ::core::option::Option<command_page::Payload>,
}
pub mod command_page {
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum Payload {
#[prost(message, tag = "3")]
Command(::prost_types::Any),
#[prost(message, tag = "4")]
External(super::PayloadReference),
}
}
impl ::prost::Name for CommandPage {
const NAME: &'static str = "CommandPage";
const PACKAGE: &'static str = "angzarr";
fn full_name() -> ::prost::alloc::string::String {
"angzarr.CommandPage".into()
}
fn type_url() -> ::prost::alloc::string::String {
"/angzarr.CommandPage".into()
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CommandBook {
#[prost(message, optional, tag = "1")]
pub cover: ::core::option::Option<Cover>,
#[prost(message, repeated, tag = "2")]
pub pages: ::prost::alloc::vec::Vec<CommandPage>,
}
impl ::prost::Name for CommandBook {
const NAME: &'static str = "CommandBook";
const PACKAGE: &'static str = "angzarr";
fn full_name() -> ::prost::alloc::string::String {
"angzarr.CommandBook".into()
}
fn type_url() -> ::prost::alloc::string::String {
"/angzarr.CommandBook".into()
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CommandRequest {
#[prost(message, optional, tag = "1")]
pub command: ::core::option::Option<CommandBook>,
#[prost(enumeration = "SyncMode", tag = "2")]
pub sync_mode: i32,
#[prost(enumeration = "CascadeErrorMode", tag = "3")]
pub cascade_error_mode: i32,
}
impl ::prost::Name for CommandRequest {
const NAME: &'static str = "CommandRequest";
const PACKAGE: &'static str = "angzarr";
fn full_name() -> ::prost::alloc::string::String {
"angzarr.CommandRequest".into()
}
fn type_url() -> ::prost::alloc::string::String {
"/angzarr.CommandRequest".into()
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ContextualCommand {
#[prost(message, optional, tag = "1")]
pub events: ::core::option::Option<EventBook>,
#[prost(message, optional, tag = "2")]
pub command: ::core::option::Option<CommandBook>,
}
impl ::prost::Name for ContextualCommand {
const NAME: &'static str = "ContextualCommand";
const PACKAGE: &'static str = "angzarr";
fn full_name() -> ::prost::alloc::string::String {
"angzarr.ContextualCommand".into()
}
fn type_url() -> ::prost::alloc::string::String {
"/angzarr.ContextualCommand".into()
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ContextualCommandRequest {
#[prost(message, optional, tag = "1")]
pub command: ::core::option::Option<ContextualCommand>,
#[prost(enumeration = "SyncMode", tag = "2")]
pub sync_mode: i32,
}
impl ::prost::Name for ContextualCommandRequest {
const NAME: &'static str = "ContextualCommandRequest";
const PACKAGE: &'static str = "angzarr";
fn full_name() -> ::prost::alloc::string::String {
"angzarr.ContextualCommandRequest".into()
}
fn type_url() -> ::prost::alloc::string::String {
"/angzarr.ContextualCommandRequest".into()
}
}
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct SequenceRange {
#[prost(uint32, tag = "1")]
pub lower: u32,
#[prost(uint32, optional, tag = "2")]
pub upper: ::core::option::Option<u32>,
}
impl ::prost::Name for SequenceRange {
const NAME: &'static str = "SequenceRange";
const PACKAGE: &'static str = "angzarr";
fn full_name() -> ::prost::alloc::string::String {
"angzarr.SequenceRange".into()
}
fn type_url() -> ::prost::alloc::string::String {
"/angzarr.SequenceRange".into()
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SequenceSet {
#[prost(uint32, repeated, tag = "1")]
pub values: ::prost::alloc::vec::Vec<u32>,
}
impl ::prost::Name for SequenceSet {
const NAME: &'static str = "SequenceSet";
const PACKAGE: &'static str = "angzarr";
fn full_name() -> ::prost::alloc::string::String {
"angzarr.SequenceSet".into()
}
fn type_url() -> ::prost::alloc::string::String {
"/angzarr.SequenceSet".into()
}
}
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct TemporalQuery {
#[prost(oneof = "temporal_query::PointInTime", tags = "1, 2")]
pub point_in_time: ::core::option::Option<temporal_query::PointInTime>,
}
pub mod temporal_query {
#[derive(Clone, Copy, PartialEq, ::prost::Oneof)]
pub enum PointInTime {
#[prost(message, tag = "1")]
AsOfTime(::prost_types::Timestamp),
#[prost(uint32, tag = "2")]
AsOfSequence(u32),
}
}
impl ::prost::Name for TemporalQuery {
const NAME: &'static str = "TemporalQuery";
const PACKAGE: &'static str = "angzarr";
fn full_name() -> ::prost::alloc::string::String {
"angzarr.TemporalQuery".into()
}
fn type_url() -> ::prost::alloc::string::String {
"/angzarr.TemporalQuery".into()
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Query {
#[prost(message, optional, tag = "1")]
pub cover: ::core::option::Option<Cover>,
#[prost(oneof = "query::Selection", tags = "3, 4, 5")]
pub selection: ::core::option::Option<query::Selection>,
}
pub mod query {
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum Selection {
#[prost(message, tag = "3")]
Range(super::SequenceRange),
#[prost(message, tag = "4")]
Sequences(super::SequenceSet),
#[prost(message, tag = "5")]
Temporal(super::TemporalQuery),
}
}
impl ::prost::Name for Query {
const NAME: &'static str = "Query";
const PACKAGE: &'static str = "angzarr";
fn full_name() -> ::prost::alloc::string::String {
"angzarr.Query".into()
}
fn type_url() -> ::prost::alloc::string::String {
"/angzarr.Query".into()
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct AggregateRoot {
#[prost(string, tag = "1")]
pub domain: ::prost::alloc::string::String,
#[prost(message, optional, tag = "2")]
pub root: ::core::option::Option<Uuid>,
}
impl ::prost::Name for AggregateRoot {
const NAME: &'static str = "AggregateRoot";
const PACKAGE: &'static str = "angzarr";
fn full_name() -> ::prost::alloc::string::String {
"angzarr.AggregateRoot".into()
}
fn type_url() -> ::prost::alloc::string::String {
"/angzarr.AggregateRoot".into()
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct EventStreamFilter {
#[prost(string, tag = "1")]
pub correlation_id: ::prost::alloc::string::String,
}
impl ::prost::Name for EventStreamFilter {
const NAME: &'static str = "EventStreamFilter";
const PACKAGE: &'static str = "angzarr";
fn full_name() -> ::prost::alloc::string::String {
"angzarr.EventStreamFilter".into()
}
fn type_url() -> ::prost::alloc::string::String {
"/angzarr.EventStreamFilter".into()
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Notification {
#[prost(message, optional, tag = "1")]
pub cover: ::core::option::Option<Cover>,
#[prost(message, optional, tag = "2")]
pub payload: ::core::option::Option<::prost_types::Any>,
#[prost(message, optional, tag = "3")]
pub sent_at: ::core::option::Option<::prost_types::Timestamp>,
#[prost(map = "string, string", tag = "4")]
pub metadata:
::std::collections::HashMap<::prost::alloc::string::String, ::prost::alloc::string::String>,
}
impl ::prost::Name for Notification {
const NAME: &'static str = "Notification";
const PACKAGE: &'static str = "angzarr";
fn full_name() -> ::prost::alloc::string::String {
"angzarr.Notification".into()
}
fn type_url() -> ::prost::alloc::string::String {
"/angzarr.Notification".into()
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct RejectionNotification {
#[prost(message, optional, tag = "1")]
pub rejected_command: ::core::option::Option<CommandBook>,
#[prost(string, tag = "2")]
pub rejection_reason: ::prost::alloc::string::String,
}
impl ::prost::Name for RejectionNotification {
const NAME: &'static str = "RejectionNotification";
const PACKAGE: &'static str = "angzarr";
fn full_name() -> ::prost::alloc::string::String {
"angzarr.RejectionNotification".into()
}
fn type_url() -> ::prost::alloc::string::String {
"/angzarr.RejectionNotification".into()
}
}
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct SequenceMismatchDetails {
#[prost(uint32, tag = "1")]
pub expected_sequence: u32,
#[prost(uint32, tag = "2")]
pub actual_sequence: u32,
#[prost(enumeration = "MergeStrategy", tag = "3")]
pub merge_strategy: i32,
}
impl ::prost::Name for SequenceMismatchDetails {
const NAME: &'static str = "SequenceMismatchDetails";
const PACKAGE: &'static str = "angzarr";
fn full_name() -> ::prost::alloc::string::String {
"angzarr.SequenceMismatchDetails".into()
}
fn type_url() -> ::prost::alloc::string::String {
"/angzarr.SequenceMismatchDetails".into()
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct EventProcessingFailedDetails {
#[prost(string, tag = "1")]
pub error: ::prost::alloc::string::String,
#[prost(uint32, tag = "2")]
pub retry_count: u32,
#[prost(bool, tag = "3")]
pub is_transient: bool,
}
impl ::prost::Name for EventProcessingFailedDetails {
const NAME: &'static str = "EventProcessingFailedDetails";
const PACKAGE: &'static str = "angzarr";
fn full_name() -> ::prost::alloc::string::String {
"angzarr.EventProcessingFailedDetails".into()
}
fn type_url() -> ::prost::alloc::string::String {
"/angzarr.EventProcessingFailedDetails".into()
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct PayloadRetrievalFailedDetails {
#[prost(enumeration = "PayloadStorageType", tag = "1")]
pub storage_type: i32,
#[prost(string, tag = "2")]
pub uri: ::prost::alloc::string::String,
#[prost(bytes = "vec", tag = "3")]
pub content_hash: ::prost::alloc::vec::Vec<u8>,
#[prost(uint64, tag = "4")]
pub original_size: u64,
#[prost(string, tag = "5")]
pub error: ::prost::alloc::string::String,
}
impl ::prost::Name for PayloadRetrievalFailedDetails {
const NAME: &'static str = "PayloadRetrievalFailedDetails";
const PACKAGE: &'static str = "angzarr";
fn full_name() -> ::prost::alloc::string::String {
"angzarr.PayloadRetrievalFailedDetails".into()
}
fn type_url() -> ::prost::alloc::string::String {
"/angzarr.PayloadRetrievalFailedDetails".into()
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct AngzarrDeadLetter {
#[prost(message, optional, tag = "1")]
pub cover: ::core::option::Option<Cover>,
#[prost(string, tag = "3")]
pub rejection_reason: ::prost::alloc::string::String,
#[prost(message, optional, tag = "7")]
pub occurred_at: ::core::option::Option<::prost_types::Timestamp>,
#[prost(map = "string, string", tag = "8")]
pub metadata:
::std::collections::HashMap<::prost::alloc::string::String, ::prost::alloc::string::String>,
#[prost(string, tag = "10")]
pub source_component: ::prost::alloc::string::String,
#[prost(string, tag = "11")]
pub source_component_type: ::prost::alloc::string::String,
#[prost(oneof = "angzarr_dead_letter::Payload", tags = "2, 9")]
pub payload: ::core::option::Option<angzarr_dead_letter::Payload>,
#[prost(oneof = "angzarr_dead_letter::RejectionDetails", tags = "12, 13, 14")]
pub rejection_details: ::core::option::Option<angzarr_dead_letter::RejectionDetails>,
}
pub mod angzarr_dead_letter {
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum Payload {
#[prost(message, tag = "2")]
RejectedCommand(super::CommandBook),
#[prost(message, tag = "9")]
RejectedEvents(super::EventBook),
}
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum RejectionDetails {
#[prost(message, tag = "12")]
SequenceMismatch(super::SequenceMismatchDetails),
#[prost(message, tag = "13")]
EventProcessingFailed(super::EventProcessingFailedDetails),
#[prost(message, tag = "14")]
PayloadRetrievalFailed(super::PayloadRetrievalFailedDetails),
}
}
impl ::prost::Name for AngzarrDeadLetter {
const NAME: &'static str = "AngzarrDeadLetter";
const PACKAGE: &'static str = "angzarr";
fn full_name() -> ::prost::alloc::string::String {
"angzarr.AngzarrDeadLetter".into()
}
fn type_url() -> ::prost::alloc::string::String {
"/angzarr.AngzarrDeadLetter".into()
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Target {
#[prost(string, tag = "1")]
pub domain: ::prost::alloc::string::String,
}
impl ::prost::Name for Target {
const NAME: &'static str = "Target";
const PACKAGE: &'static str = "angzarr";
fn full_name() -> ::prost::alloc::string::String {
"angzarr.Target".into()
}
fn type_url() -> ::prost::alloc::string::String {
"/angzarr.Target".into()
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ComponentDescriptor {
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub component_type: ::prost::alloc::string::String,
#[prost(message, repeated, tag = "3")]
pub inputs: ::prost::alloc::vec::Vec<Target>,
}
impl ::prost::Name for ComponentDescriptor {
const NAME: &'static str = "ComponentDescriptor";
const PACKAGE: &'static str = "angzarr";
fn full_name() -> ::prost::alloc::string::String {
"angzarr.ComponentDescriptor".into()
}
fn type_url() -> ::prost::alloc::string::String {
"/angzarr.ComponentDescriptor".into()
}
}
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct GetDescriptorRequest {}
impl ::prost::Name for GetDescriptorRequest {
const NAME: &'static str = "GetDescriptorRequest";
const PACKAGE: &'static str = "angzarr";
fn full_name() -> ::prost::alloc::string::String {
"angzarr.GetDescriptorRequest".into()
}
fn type_url() -> ::prost::alloc::string::String {
"/angzarr.GetDescriptorRequest".into()
}
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum SyncMode {
Async = 0,
Simple = 1,
Cascade = 2,
}
impl SyncMode {
pub fn as_str_name(&self) -> &'static str {
match self {
Self::Async => "SYNC_MODE_ASYNC",
Self::Simple => "SYNC_MODE_SIMPLE",
Self::Cascade => "SYNC_MODE_CASCADE",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"SYNC_MODE_ASYNC" => Some(Self::Async),
"SYNC_MODE_SIMPLE" => Some(Self::Simple),
"SYNC_MODE_CASCADE" => Some(Self::Cascade),
_ => None,
}
}
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum CascadeErrorMode {
CascadeErrorFailFast = 0,
CascadeErrorContinue = 1,
CascadeErrorCompensate = 2,
CascadeErrorDeadLetter = 3,
}
impl CascadeErrorMode {
pub fn as_str_name(&self) -> &'static str {
match self {
Self::CascadeErrorFailFast => "CASCADE_ERROR_FAIL_FAST",
Self::CascadeErrorContinue => "CASCADE_ERROR_CONTINUE",
Self::CascadeErrorCompensate => "CASCADE_ERROR_COMPENSATE",
Self::CascadeErrorDeadLetter => "CASCADE_ERROR_DEAD_LETTER",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"CASCADE_ERROR_FAIL_FAST" => Some(Self::CascadeErrorFailFast),
"CASCADE_ERROR_CONTINUE" => Some(Self::CascadeErrorContinue),
"CASCADE_ERROR_COMPENSATE" => Some(Self::CascadeErrorCompensate),
"CASCADE_ERROR_DEAD_LETTER" => Some(Self::CascadeErrorDeadLetter),
_ => None,
}
}
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum MergeStrategy {
MergeCommutative = 0,
MergeStrict = 1,
MergeAggregateHandles = 2,
MergeManual = 3,
}
impl MergeStrategy {
pub fn as_str_name(&self) -> &'static str {
match self {
Self::MergeCommutative => "MERGE_COMMUTATIVE",
Self::MergeStrict => "MERGE_STRICT",
Self::MergeAggregateHandles => "MERGE_AGGREGATE_HANDLES",
Self::MergeManual => "MERGE_MANUAL",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"MERGE_COMMUTATIVE" => Some(Self::MergeCommutative),
"MERGE_STRICT" => Some(Self::MergeStrict),
"MERGE_AGGREGATE_HANDLES" => Some(Self::MergeAggregateHandles),
"MERGE_MANUAL" => Some(Self::MergeManual),
_ => None,
}
}
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum SnapshotRetention {
RetentionDefault = 0,
RetentionPersist = 1,
RetentionTransient = 2,
}
impl SnapshotRetention {
pub fn as_str_name(&self) -> &'static str {
match self {
Self::RetentionDefault => "RETENTION_DEFAULT",
Self::RetentionPersist => "RETENTION_PERSIST",
Self::RetentionTransient => "RETENTION_TRANSIENT",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"RETENTION_DEFAULT" => Some(Self::RetentionDefault),
"RETENTION_PERSIST" => Some(Self::RetentionPersist),
"RETENTION_TRANSIENT" => Some(Self::RetentionTransient),
_ => None,
}
}
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum PayloadStorageType {
Unspecified = 0,
Filesystem = 1,
Gcs = 2,
S3 = 3,
}
impl PayloadStorageType {
pub fn as_str_name(&self) -> &'static str {
match self {
Self::Unspecified => "PAYLOAD_STORAGE_TYPE_UNSPECIFIED",
Self::Filesystem => "PAYLOAD_STORAGE_TYPE_FILESYSTEM",
Self::Gcs => "PAYLOAD_STORAGE_TYPE_GCS",
Self::S3 => "PAYLOAD_STORAGE_TYPE_S3",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"PAYLOAD_STORAGE_TYPE_UNSPECIFIED" => Some(Self::Unspecified),
"PAYLOAD_STORAGE_TYPE_FILESYSTEM" => Some(Self::Filesystem),
"PAYLOAD_STORAGE_TYPE_GCS" => Some(Self::Gcs),
"PAYLOAD_STORAGE_TYPE_S3" => Some(Self::S3),
_ => None,
}
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ReplayRequest {
#[prost(message, optional, tag = "1")]
pub base_snapshot: ::core::option::Option<Snapshot>,
#[prost(message, repeated, tag = "2")]
pub events: ::prost::alloc::vec::Vec<EventPage>,
}
impl ::prost::Name for ReplayRequest {
const NAME: &'static str = "ReplayRequest";
const PACKAGE: &'static str = "angzarr";
fn full_name() -> ::prost::alloc::string::String {
"angzarr.ReplayRequest".into()
}
fn type_url() -> ::prost::alloc::string::String {
"/angzarr.ReplayRequest".into()
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ReplayResponse {
#[prost(message, optional, tag = "1")]
pub state: ::core::option::Option<::prost_types::Any>,
}
impl ::prost::Name for ReplayResponse {
const NAME: &'static str = "ReplayResponse";
const PACKAGE: &'static str = "angzarr";
fn full_name() -> ::prost::alloc::string::String {
"angzarr.ReplayResponse".into()
}
fn type_url() -> ::prost::alloc::string::String {
"/angzarr.ReplayResponse".into()
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CommandResponse {
#[prost(message, optional, tag = "1")]
pub events: ::core::option::Option<EventBook>,
#[prost(message, repeated, tag = "2")]
pub projections: ::prost::alloc::vec::Vec<Projection>,
#[prost(message, repeated, tag = "3")]
pub cascade_errors: ::prost::alloc::vec::Vec<CascadeError>,
}
impl ::prost::Name for CommandResponse {
const NAME: &'static str = "CommandResponse";
const PACKAGE: &'static str = "angzarr";
fn full_name() -> ::prost::alloc::string::String {
"angzarr.CommandResponse".into()
}
fn type_url() -> ::prost::alloc::string::String {
"/angzarr.CommandResponse".into()
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CascadeError {
#[prost(string, tag = "1")]
pub component_name: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub component_type: ::prost::alloc::string::String,
#[prost(string, tag = "3")]
pub error_message: ::prost::alloc::string::String,
#[prost(string, tag = "4")]
pub source_domain: ::prost::alloc::string::String,
}
impl ::prost::Name for CascadeError {
const NAME: &'static str = "CascadeError";
const PACKAGE: &'static str = "angzarr";
fn full_name() -> ::prost::alloc::string::String {
"angzarr.CascadeError".into()
}
fn type_url() -> ::prost::alloc::string::String {
"/angzarr.CascadeError".into()
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct RevocationResponse {
#[prost(bool, tag = "1")]
pub emit_system_revocation: bool,
#[prost(bool, tag = "2")]
pub send_to_dead_letter_queue: bool,
#[prost(bool, tag = "3")]
pub escalate: bool,
#[prost(bool, tag = "4")]
pub abort: bool,
#[prost(string, tag = "5")]
pub reason: ::prost::alloc::string::String,
}
impl ::prost::Name for RevocationResponse {
const NAME: &'static str = "RevocationResponse";
const PACKAGE: &'static str = "angzarr";
fn full_name() -> ::prost::alloc::string::String {
"angzarr.RevocationResponse".into()
}
fn type_url() -> ::prost::alloc::string::String {
"/angzarr.RevocationResponse".into()
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct BusinessResponse {
#[prost(oneof = "business_response::Result", tags = "1, 2, 3")]
pub result: ::core::option::Option<business_response::Result>,
}
pub mod business_response {
#[allow(clippy::large_enum_variant)]
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum Result {
#[prost(message, tag = "1")]
Events(super::EventBook),
#[prost(message, tag = "2")]
Revocation(super::RevocationResponse),
#[prost(message, tag = "3")]
Notification(super::Notification),
}
}
impl ::prost::Name for BusinessResponse {
const NAME: &'static str = "BusinessResponse";
const PACKAGE: &'static str = "angzarr";
fn full_name() -> ::prost::alloc::string::String {
"angzarr.BusinessResponse".into()
}
fn type_url() -> ::prost::alloc::string::String {
"/angzarr.BusinessResponse".into()
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SpeculateCommandHandlerRequest {
#[prost(message, optional, tag = "1")]
pub command: ::core::option::Option<CommandBook>,
#[prost(message, optional, tag = "2")]
pub point_in_time: ::core::option::Option<TemporalQuery>,
}
impl ::prost::Name for SpeculateCommandHandlerRequest {
const NAME: &'static str = "SpeculateCommandHandlerRequest";
const PACKAGE: &'static str = "angzarr";
fn full_name() -> ::prost::alloc::string::String {
"angzarr.SpeculateCommandHandlerRequest".into()
}
fn type_url() -> ::prost::alloc::string::String {
"/angzarr.SpeculateCommandHandlerRequest".into()
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct FactInjectionResponse {
#[prost(message, optional, tag = "1")]
pub events: ::core::option::Option<EventBook>,
#[prost(bool, tag = "2")]
pub already_processed: bool,
#[prost(message, repeated, tag = "3")]
pub projections: ::prost::alloc::vec::Vec<Projection>,
}
impl ::prost::Name for FactInjectionResponse {
const NAME: &'static str = "FactInjectionResponse";
const PACKAGE: &'static str = "angzarr";
fn full_name() -> ::prost::alloc::string::String {
"angzarr.FactInjectionResponse".into()
}
fn type_url() -> ::prost::alloc::string::String {
"/angzarr.FactInjectionResponse".into()
}
}
pub mod command_handler_service_client {
#![allow(
unused_variables,
dead_code,
missing_docs,
clippy::wildcard_imports,
clippy::let_unit_value
)]
use tonic::codegen::http::Uri;
use tonic::codegen::*;
#[derive(Debug, Clone)]
pub struct CommandHandlerServiceClient<T> {
inner: tonic::client::Grpc<T>,
}
impl CommandHandlerServiceClient<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> CommandHandlerServiceClient<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,
) -> CommandHandlerServiceClient<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,
{
CommandHandlerServiceClient::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 handle(
&mut self,
request: impl tonic::IntoRequest<super::ContextualCommand>,
) -> std::result::Result<tonic::Response<super::BusinessResponse>, 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("/angzarr.CommandHandlerService/Handle");
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("angzarr.CommandHandlerService", "Handle"));
self.inner.unary(req, path, codec).await
}
pub async fn replay(
&mut self,
request: impl tonic::IntoRequest<super::ReplayRequest>,
) -> std::result::Result<tonic::Response<super::ReplayResponse>, 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("/angzarr.CommandHandlerService/Replay");
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("angzarr.CommandHandlerService", "Replay"));
self.inner.unary(req, path, codec).await
}
}
}
pub mod command_handler_coordinator_service_client {
#![allow(
unused_variables,
dead_code,
missing_docs,
clippy::wildcard_imports,
clippy::let_unit_value
)]
use tonic::codegen::http::Uri;
use tonic::codegen::*;
#[derive(Debug, Clone)]
pub struct CommandHandlerCoordinatorServiceClient<T> {
inner: tonic::client::Grpc<T>,
}
impl CommandHandlerCoordinatorServiceClient<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> CommandHandlerCoordinatorServiceClient<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,
) -> CommandHandlerCoordinatorServiceClient<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,
{
CommandHandlerCoordinatorServiceClient::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 handle_command(
&mut self,
request: impl tonic::IntoRequest<super::CommandRequest>,
) -> std::result::Result<tonic::Response<super::CommandResponse>, 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(
"/angzarr.CommandHandlerCoordinatorService/HandleCommand",
);
let mut req = request.into_request();
req.extensions_mut().insert(GrpcMethod::new(
"angzarr.CommandHandlerCoordinatorService",
"HandleCommand",
));
self.inner.unary(req, path, codec).await
}
pub async fn handle_event(
&mut self,
request: impl tonic::IntoRequest<super::EventRequest>,
) -> std::result::Result<tonic::Response<super::FactInjectionResponse>, 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(
"/angzarr.CommandHandlerCoordinatorService/HandleEvent",
);
let mut req = request.into_request();
req.extensions_mut().insert(GrpcMethod::new(
"angzarr.CommandHandlerCoordinatorService",
"HandleEvent",
));
self.inner.unary(req, path, codec).await
}
pub async fn handle_sync_speculative(
&mut self,
request: impl tonic::IntoRequest<super::SpeculateCommandHandlerRequest>,
) -> std::result::Result<tonic::Response<super::CommandResponse>, 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(
"/angzarr.CommandHandlerCoordinatorService/HandleSyncSpeculative",
);
let mut req = request.into_request();
req.extensions_mut().insert(GrpcMethod::new(
"angzarr.CommandHandlerCoordinatorService",
"HandleSyncSpeculative",
));
self.inner.unary(req, path, codec).await
}
pub async fn handle_compensation(
&mut self,
request: impl tonic::IntoRequest<super::CommandRequest>,
) -> std::result::Result<tonic::Response<super::BusinessResponse>, 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(
"/angzarr.CommandHandlerCoordinatorService/HandleCompensation",
);
let mut req = request.into_request();
req.extensions_mut().insert(GrpcMethod::new(
"angzarr.CommandHandlerCoordinatorService",
"HandleCompensation",
));
self.inner.unary(req, path, codec).await
}
}
}
pub mod command_handler_service_server {
#![allow(
unused_variables,
dead_code,
missing_docs,
clippy::wildcard_imports,
clippy::let_unit_value
)]
use tonic::codegen::*;
#[async_trait]
pub trait CommandHandlerService: std::marker::Send + std::marker::Sync + 'static {
async fn handle(
&self,
request: tonic::Request<super::ContextualCommand>,
) -> std::result::Result<tonic::Response<super::BusinessResponse>, tonic::Status>;
async fn replay(
&self,
request: tonic::Request<super::ReplayRequest>,
) -> std::result::Result<tonic::Response<super::ReplayResponse>, tonic::Status>;
}
#[derive(Debug)]
pub struct CommandHandlerServiceServer<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> CommandHandlerServiceServer<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 CommandHandlerServiceServer<T>
where
T: CommandHandlerService,
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() {
"/angzarr.CommandHandlerService/Handle" => {
#[allow(non_camel_case_types)]
struct HandleSvc<T: CommandHandlerService>(pub Arc<T>);
impl<T: CommandHandlerService>
tonic::server::UnaryService<super::ContextualCommand> for HandleSvc<T>
{
type Response = super::BusinessResponse;
type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>;
fn call(
&mut self,
request: tonic::Request<super::ContextualCommand>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as CommandHandlerService>::handle(&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 = HandleSvc(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)
}
"/angzarr.CommandHandlerService/Replay" => {
#[allow(non_camel_case_types)]
struct ReplaySvc<T: CommandHandlerService>(pub Arc<T>);
impl<T: CommandHandlerService> tonic::server::UnaryService<super::ReplayRequest> for ReplaySvc<T> {
type Response = super::ReplayResponse;
type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>;
fn call(
&mut self,
request: tonic::Request<super::ReplayRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as CommandHandlerService>::replay(&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 = ReplaySvc(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 CommandHandlerServiceServer<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 = "angzarr.CommandHandlerService";
impl<T> tonic::server::NamedService for CommandHandlerServiceServer<T> {
const NAME: &'static str = SERVICE_NAME;
}
}
pub mod command_handler_coordinator_service_server {
#![allow(
unused_variables,
dead_code,
missing_docs,
clippy::wildcard_imports,
clippy::let_unit_value
)]
use tonic::codegen::*;
#[async_trait]
pub trait CommandHandlerCoordinatorService:
std::marker::Send + std::marker::Sync + 'static
{
async fn handle_command(
&self,
request: tonic::Request<super::CommandRequest>,
) -> std::result::Result<tonic::Response<super::CommandResponse>, tonic::Status>;
async fn handle_event(
&self,
request: tonic::Request<super::EventRequest>,
) -> std::result::Result<tonic::Response<super::FactInjectionResponse>, tonic::Status>;
async fn handle_sync_speculative(
&self,
request: tonic::Request<super::SpeculateCommandHandlerRequest>,
) -> std::result::Result<tonic::Response<super::CommandResponse>, tonic::Status>;
async fn handle_compensation(
&self,
request: tonic::Request<super::CommandRequest>,
) -> std::result::Result<tonic::Response<super::BusinessResponse>, tonic::Status>;
}
#[derive(Debug)]
pub struct CommandHandlerCoordinatorServiceServer<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> CommandHandlerCoordinatorServiceServer<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 CommandHandlerCoordinatorServiceServer<T>
where
T: CommandHandlerCoordinatorService,
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() {
"/angzarr.CommandHandlerCoordinatorService/HandleCommand" => {
#[allow(non_camel_case_types)]
struct HandleCommandSvc<T: CommandHandlerCoordinatorService>(pub Arc<T>);
impl<T: CommandHandlerCoordinatorService>
tonic::server::UnaryService<super::CommandRequest> for HandleCommandSvc<T>
{
type Response = super::CommandResponse;
type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>;
fn call(
&mut self,
request: tonic::Request<super::CommandRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as CommandHandlerCoordinatorService>::handle_command(
&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 = HandleCommandSvc(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)
}
"/angzarr.CommandHandlerCoordinatorService/HandleEvent" => {
#[allow(non_camel_case_types)]
struct HandleEventSvc<T: CommandHandlerCoordinatorService>(pub Arc<T>);
impl<T: CommandHandlerCoordinatorService>
tonic::server::UnaryService<super::EventRequest> for HandleEventSvc<T>
{
type Response = super::FactInjectionResponse;
type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>;
fn call(
&mut self,
request: tonic::Request<super::EventRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as CommandHandlerCoordinatorService>::handle_event(
&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 = HandleEventSvc(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)
}
"/angzarr.CommandHandlerCoordinatorService/HandleSyncSpeculative" => {
#[allow(non_camel_case_types)]
struct HandleSyncSpeculativeSvc<T: CommandHandlerCoordinatorService>(
pub Arc<T>,
);
impl<T: CommandHandlerCoordinatorService>
tonic::server::UnaryService<super::SpeculateCommandHandlerRequest>
for HandleSyncSpeculativeSvc<T>
{
type Response = super::CommandResponse;
type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>;
fn call(
&mut self,
request: tonic::Request<super::SpeculateCommandHandlerRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as CommandHandlerCoordinatorService>::handle_sync_speculative(
&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 = HandleSyncSpeculativeSvc(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)
}
"/angzarr.CommandHandlerCoordinatorService/HandleCompensation" => {
#[allow(non_camel_case_types)]
struct HandleCompensationSvc<T: CommandHandlerCoordinatorService>(pub Arc<T>);
impl<T: CommandHandlerCoordinatorService>
tonic::server::UnaryService<super::CommandRequest>
for HandleCompensationSvc<T>
{
type Response = super::BusinessResponse;
type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>;
fn call(
&mut self,
request: tonic::Request<super::CommandRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as CommandHandlerCoordinatorService>::handle_compensation(
&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 = HandleCompensationSvc(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 CommandHandlerCoordinatorServiceServer<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 = "angzarr.CommandHandlerCoordinatorService";
impl<T> tonic::server::NamedService for CommandHandlerCoordinatorServiceServer<T> {
const NAME: &'static str = SERVICE_NAME;
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SpeculateProjectorRequest {
#[prost(message, optional, tag = "1")]
pub events: ::core::option::Option<EventBook>,
}
impl ::prost::Name for SpeculateProjectorRequest {
const NAME: &'static str = "SpeculateProjectorRequest";
const PACKAGE: &'static str = "angzarr";
fn full_name() -> ::prost::alloc::string::String {
"angzarr.SpeculateProjectorRequest".into()
}
fn type_url() -> ::prost::alloc::string::String {
"/angzarr.SpeculateProjectorRequest".into()
}
}
pub mod projector_service_client {
#![allow(
unused_variables,
dead_code,
missing_docs,
clippy::wildcard_imports,
clippy::let_unit_value
)]
use tonic::codegen::http::Uri;
use tonic::codegen::*;
#[derive(Debug, Clone)]
pub struct ProjectorServiceClient<T> {
inner: tonic::client::Grpc<T>,
}
impl ProjectorServiceClient<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> ProjectorServiceClient<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,
) -> ProjectorServiceClient<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,
{
ProjectorServiceClient::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 handle(
&mut self,
request: impl tonic::IntoRequest<super::EventBook>,
) -> std::result::Result<tonic::Response<super::Projection>, 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("/angzarr.ProjectorService/Handle");
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("angzarr.ProjectorService", "Handle"));
self.inner.unary(req, path, codec).await
}
pub async fn handle_speculative(
&mut self,
request: impl tonic::IntoRequest<super::EventBook>,
) -> std::result::Result<tonic::Response<super::Projection>, 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("/angzarr.ProjectorService/HandleSpeculative");
let mut req = request.into_request();
req.extensions_mut().insert(GrpcMethod::new(
"angzarr.ProjectorService",
"HandleSpeculative",
));
self.inner.unary(req, path, codec).await
}
}
}
pub mod projector_coordinator_service_client {
#![allow(
unused_variables,
dead_code,
missing_docs,
clippy::wildcard_imports,
clippy::let_unit_value
)]
use tonic::codegen::http::Uri;
use tonic::codegen::*;
#[derive(Debug, Clone)]
pub struct ProjectorCoordinatorServiceClient<T> {
inner: tonic::client::Grpc<T>,
}
impl ProjectorCoordinatorServiceClient<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> ProjectorCoordinatorServiceClient<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,
) -> ProjectorCoordinatorServiceClient<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,
{
ProjectorCoordinatorServiceClient::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 handle_sync(
&mut self,
request: impl tonic::IntoRequest<super::EventRequest>,
) -> std::result::Result<tonic::Response<super::Projection>, 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(
"/angzarr.ProjectorCoordinatorService/HandleSync",
);
let mut req = request.into_request();
req.extensions_mut().insert(GrpcMethod::new(
"angzarr.ProjectorCoordinatorService",
"HandleSync",
));
self.inner.unary(req, path, codec).await
}
pub async fn handle(
&mut self,
request: impl tonic::IntoRequest<super::EventBook>,
) -> std::result::Result<tonic::Response<()>, 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("/angzarr.ProjectorCoordinatorService/Handle");
let mut req = request.into_request();
req.extensions_mut().insert(GrpcMethod::new(
"angzarr.ProjectorCoordinatorService",
"Handle",
));
self.inner.unary(req, path, codec).await
}
pub async fn handle_speculative(
&mut self,
request: impl tonic::IntoRequest<super::SpeculateProjectorRequest>,
) -> std::result::Result<tonic::Response<super::Projection>, 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(
"/angzarr.ProjectorCoordinatorService/HandleSpeculative",
);
let mut req = request.into_request();
req.extensions_mut().insert(GrpcMethod::new(
"angzarr.ProjectorCoordinatorService",
"HandleSpeculative",
));
self.inner.unary(req, path, codec).await
}
}
}
pub mod projector_service_server {
#![allow(
unused_variables,
dead_code,
missing_docs,
clippy::wildcard_imports,
clippy::let_unit_value
)]
use tonic::codegen::*;
#[async_trait]
pub trait ProjectorService: std::marker::Send + std::marker::Sync + 'static {
async fn handle(
&self,
request: tonic::Request<super::EventBook>,
) -> std::result::Result<tonic::Response<super::Projection>, tonic::Status>;
async fn handle_speculative(
&self,
request: tonic::Request<super::EventBook>,
) -> std::result::Result<tonic::Response<super::Projection>, tonic::Status>;
}
#[derive(Debug)]
pub struct ProjectorServiceServer<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> ProjectorServiceServer<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 ProjectorServiceServer<T>
where
T: ProjectorService,
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() {
"/angzarr.ProjectorService/Handle" => {
#[allow(non_camel_case_types)]
struct HandleSvc<T: ProjectorService>(pub Arc<T>);
impl<T: ProjectorService> tonic::server::UnaryService<super::EventBook> for HandleSvc<T> {
type Response = super::Projection;
type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>;
fn call(
&mut self,
request: tonic::Request<super::EventBook>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as ProjectorService>::handle(&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 = HandleSvc(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)
}
"/angzarr.ProjectorService/HandleSpeculative" => {
#[allow(non_camel_case_types)]
struct HandleSpeculativeSvc<T: ProjectorService>(pub Arc<T>);
impl<T: ProjectorService> tonic::server::UnaryService<super::EventBook>
for HandleSpeculativeSvc<T>
{
type Response = super::Projection;
type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>;
fn call(
&mut self,
request: tonic::Request<super::EventBook>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as ProjectorService>::handle_speculative(&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 = HandleSpeculativeSvc(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 ProjectorServiceServer<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 = "angzarr.ProjectorService";
impl<T> tonic::server::NamedService for ProjectorServiceServer<T> {
const NAME: &'static str = SERVICE_NAME;
}
}
pub mod projector_coordinator_service_server {
#![allow(
unused_variables,
dead_code,
missing_docs,
clippy::wildcard_imports,
clippy::let_unit_value
)]
use tonic::codegen::*;
#[async_trait]
pub trait ProjectorCoordinatorService: std::marker::Send + std::marker::Sync + 'static {
async fn handle_sync(
&self,
request: tonic::Request<super::EventRequest>,
) -> std::result::Result<tonic::Response<super::Projection>, tonic::Status>;
async fn handle(
&self,
request: tonic::Request<super::EventBook>,
) -> std::result::Result<tonic::Response<()>, tonic::Status>;
async fn handle_speculative(
&self,
request: tonic::Request<super::SpeculateProjectorRequest>,
) -> std::result::Result<tonic::Response<super::Projection>, tonic::Status>;
}
#[derive(Debug)]
pub struct ProjectorCoordinatorServiceServer<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> ProjectorCoordinatorServiceServer<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 ProjectorCoordinatorServiceServer<T>
where
T: ProjectorCoordinatorService,
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() {
"/angzarr.ProjectorCoordinatorService/HandleSync" => {
#[allow(non_camel_case_types)]
struct HandleSyncSvc<T: ProjectorCoordinatorService>(pub Arc<T>);
impl<T: ProjectorCoordinatorService>
tonic::server::UnaryService<super::EventRequest> for HandleSyncSvc<T>
{
type Response = super::Projection;
type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>;
fn call(
&mut self,
request: tonic::Request<super::EventRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as ProjectorCoordinatorService>::handle_sync(&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 = HandleSyncSvc(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)
}
"/angzarr.ProjectorCoordinatorService/Handle" => {
#[allow(non_camel_case_types)]
struct HandleSvc<T: ProjectorCoordinatorService>(pub Arc<T>);
impl<T: ProjectorCoordinatorService>
tonic::server::UnaryService<super::EventBook> for HandleSvc<T>
{
type Response = ();
type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>;
fn call(
&mut self,
request: tonic::Request<super::EventBook>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as ProjectorCoordinatorService>::handle(&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 = HandleSvc(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)
}
"/angzarr.ProjectorCoordinatorService/HandleSpeculative" => {
#[allow(non_camel_case_types)]
struct HandleSpeculativeSvc<T: ProjectorCoordinatorService>(pub Arc<T>);
impl<T: ProjectorCoordinatorService>
tonic::server::UnaryService<super::SpeculateProjectorRequest>
for HandleSpeculativeSvc<T>
{
type Response = super::Projection;
type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>;
fn call(
&mut self,
request: tonic::Request<super::SpeculateProjectorRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as ProjectorCoordinatorService>::handle_speculative(
&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 = HandleSpeculativeSvc(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 ProjectorCoordinatorServiceServer<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 = "angzarr.ProjectorCoordinatorService";
impl<T> tonic::server::NamedService for ProjectorCoordinatorServiceServer<T> {
const NAME: &'static str = SERVICE_NAME;
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SagaHandleRequest {
#[prost(message, optional, tag = "1")]
pub source: ::core::option::Option<EventBook>,
#[prost(enumeration = "SyncMode", tag = "2")]
pub sync_mode: i32,
#[prost(enumeration = "CascadeErrorMode", tag = "3")]
pub cascade_error_mode: i32,
}
impl ::prost::Name for SagaHandleRequest {
const NAME: &'static str = "SagaHandleRequest";
const PACKAGE: &'static str = "angzarr";
fn full_name() -> ::prost::alloc::string::String {
"angzarr.SagaHandleRequest".into()
}
fn type_url() -> ::prost::alloc::string::String {
"/angzarr.SagaHandleRequest".into()
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SpeculateSagaRequest {
#[prost(message, optional, tag = "1")]
pub request: ::core::option::Option<SagaHandleRequest>,
}
impl ::prost::Name for SpeculateSagaRequest {
const NAME: &'static str = "SpeculateSagaRequest";
const PACKAGE: &'static str = "angzarr";
fn full_name() -> ::prost::alloc::string::String {
"angzarr.SpeculateSagaRequest".into()
}
fn type_url() -> ::prost::alloc::string::String {
"/angzarr.SpeculateSagaRequest".into()
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SagaResponse {
#[prost(message, repeated, tag = "1")]
pub commands: ::prost::alloc::vec::Vec<CommandBook>,
#[prost(message, repeated, tag = "2")]
pub events: ::prost::alloc::vec::Vec<EventBook>,
}
impl ::prost::Name for SagaResponse {
const NAME: &'static str = "SagaResponse";
const PACKAGE: &'static str = "angzarr";
fn full_name() -> ::prost::alloc::string::String {
"angzarr.SagaResponse".into()
}
fn type_url() -> ::prost::alloc::string::String {
"/angzarr.SagaResponse".into()
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SagaCompensationFailed {
#[prost(message, optional, tag = "1")]
pub triggering_aggregate: ::core::option::Option<Cover>,
#[prost(uint32, tag = "2")]
pub triggering_event_sequence: u32,
#[prost(string, tag = "3")]
pub saga_name: ::prost::alloc::string::String,
#[prost(string, tag = "4")]
pub rejection_reason: ::prost::alloc::string::String,
#[prost(string, tag = "5")]
pub compensation_failure_reason: ::prost::alloc::string::String,
#[prost(message, optional, tag = "6")]
pub rejected_command: ::core::option::Option<CommandBook>,
#[prost(message, optional, tag = "7")]
pub occurred_at: ::core::option::Option<::prost_types::Timestamp>,
}
impl ::prost::Name for SagaCompensationFailed {
const NAME: &'static str = "SagaCompensationFailed";
const PACKAGE: &'static str = "angzarr";
fn full_name() -> ::prost::alloc::string::String {
"angzarr.SagaCompensationFailed".into()
}
fn type_url() -> ::prost::alloc::string::String {
"/angzarr.SagaCompensationFailed".into()
}
}
pub mod saga_service_client {
#![allow(
unused_variables,
dead_code,
missing_docs,
clippy::wildcard_imports,
clippy::let_unit_value
)]
use tonic::codegen::http::Uri;
use tonic::codegen::*;
#[derive(Debug, Clone)]
pub struct SagaServiceClient<T> {
inner: tonic::client::Grpc<T>,
}
impl SagaServiceClient<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> SagaServiceClient<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,
) -> SagaServiceClient<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,
{
SagaServiceClient::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 handle(
&mut self,
request: impl tonic::IntoRequest<super::SagaHandleRequest>,
) -> std::result::Result<tonic::Response<super::SagaResponse>, 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("/angzarr.SagaService/Handle");
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("angzarr.SagaService", "Handle"));
self.inner.unary(req, path, codec).await
}
}
}
pub mod saga_coordinator_service_client {
#![allow(
unused_variables,
dead_code,
missing_docs,
clippy::wildcard_imports,
clippy::let_unit_value
)]
use tonic::codegen::http::Uri;
use tonic::codegen::*;
#[derive(Debug, Clone)]
pub struct SagaCoordinatorServiceClient<T> {
inner: tonic::client::Grpc<T>,
}
impl SagaCoordinatorServiceClient<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> SagaCoordinatorServiceClient<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,
) -> SagaCoordinatorServiceClient<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,
{
SagaCoordinatorServiceClient::new(InterceptedService::new(inner, interceptor))
}
#[must_use]
pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.inner = self.inner.send_compressed(encoding);
self
}
#[must_use]
pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.inner = self.inner.accept_compressed(encoding);
self
}
#[must_use]
pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
self.inner = self.inner.max_decoding_message_size(limit);
self
}
#[must_use]
pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
self.inner = self.inner.max_encoding_message_size(limit);
self
}
pub async fn execute(
&mut self,
request: impl tonic::IntoRequest<super::SagaHandleRequest>,
) -> std::result::Result<tonic::Response<super::SagaResponse>, 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("/angzarr.SagaCoordinatorService/Execute");
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("angzarr.SagaCoordinatorService", "Execute"));
self.inner.unary(req, path, codec).await
}
pub async fn execute_speculative(
&mut self,
request: impl tonic::IntoRequest<super::SpeculateSagaRequest>,
) -> std::result::Result<tonic::Response<super::SagaResponse>, 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(
"/angzarr.SagaCoordinatorService/ExecuteSpeculative",
);
let mut req = request.into_request();
req.extensions_mut().insert(GrpcMethod::new(
"angzarr.SagaCoordinatorService",
"ExecuteSpeculative",
));
self.inner.unary(req, path, codec).await
}
}
}
pub mod saga_service_server {
#![allow(
unused_variables,
dead_code,
missing_docs,
clippy::wildcard_imports,
clippy::let_unit_value
)]
use tonic::codegen::*;
#[async_trait]
pub trait SagaService: std::marker::Send + std::marker::Sync + 'static {
async fn handle(
&self,
request: tonic::Request<super::SagaHandleRequest>,
) -> std::result::Result<tonic::Response<super::SagaResponse>, tonic::Status>;
}
#[derive(Debug)]
pub struct SagaServiceServer<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> SagaServiceServer<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 SagaServiceServer<T>
where
T: SagaService,
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() {
"/angzarr.SagaService/Handle" => {
#[allow(non_camel_case_types)]
struct HandleSvc<T: SagaService>(pub Arc<T>);
impl<T: SagaService> tonic::server::UnaryService<super::SagaHandleRequest> for HandleSvc<T> {
type Response = super::SagaResponse;
type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>;
fn call(
&mut self,
request: tonic::Request<super::SagaHandleRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut =
async move { <T as SagaService>::handle(&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 = HandleSvc(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 SagaServiceServer<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 = "angzarr.SagaService";
impl<T> tonic::server::NamedService for SagaServiceServer<T> {
const NAME: &'static str = SERVICE_NAME;
}
}
pub mod saga_coordinator_service_server {
#![allow(
unused_variables,
dead_code,
missing_docs,
clippy::wildcard_imports,
clippy::let_unit_value
)]
use tonic::codegen::*;
#[async_trait]
pub trait SagaCoordinatorService: std::marker::Send + std::marker::Sync + 'static {
async fn execute(
&self,
request: tonic::Request<super::SagaHandleRequest>,
) -> std::result::Result<tonic::Response<super::SagaResponse>, tonic::Status>;
async fn execute_speculative(
&self,
request: tonic::Request<super::SpeculateSagaRequest>,
) -> std::result::Result<tonic::Response<super::SagaResponse>, tonic::Status>;
}
#[derive(Debug)]
pub struct SagaCoordinatorServiceServer<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> SagaCoordinatorServiceServer<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 SagaCoordinatorServiceServer<T>
where
T: SagaCoordinatorService,
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() {
"/angzarr.SagaCoordinatorService/Execute" => {
#[allow(non_camel_case_types)]
struct ExecuteSvc<T: SagaCoordinatorService>(pub Arc<T>);
impl<T: SagaCoordinatorService>
tonic::server::UnaryService<super::SagaHandleRequest> for ExecuteSvc<T>
{
type Response = super::SagaResponse;
type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>;
fn call(
&mut self,
request: tonic::Request<super::SagaHandleRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as SagaCoordinatorService>::execute(&inner, request).await
};
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let max_decoding_message_size = self.max_decoding_message_size;
let max_encoding_message_size = self.max_encoding_message_size;
let inner = self.inner.clone();
let fut = async move {
let method = ExecuteSvc(inner);
let codec = tonic::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)
}
"/angzarr.SagaCoordinatorService/ExecuteSpeculative" => {
#[allow(non_camel_case_types)]
struct ExecuteSpeculativeSvc<T: SagaCoordinatorService>(pub Arc<T>);
impl<T: SagaCoordinatorService>
tonic::server::UnaryService<super::SpeculateSagaRequest>
for ExecuteSpeculativeSvc<T>
{
type Response = super::SagaResponse;
type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>;
fn call(
&mut self,
request: tonic::Request<super::SpeculateSagaRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as SagaCoordinatorService>::execute_speculative(&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 = ExecuteSpeculativeSvc(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 SagaCoordinatorServiceServer<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 = "angzarr.SagaCoordinatorService";
impl<T> tonic::server::NamedService for SagaCoordinatorServiceServer<T> {
const NAME: &'static str = SERVICE_NAME;
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ProcessManagerCoordinatorRequest {
#[prost(message, optional, tag = "1")]
pub trigger: ::core::option::Option<EventBook>,
#[prost(enumeration = "SyncMode", tag = "2")]
pub sync_mode: i32,
#[prost(enumeration = "CascadeErrorMode", tag = "3")]
pub cascade_error_mode: i32,
}
impl ::prost::Name for ProcessManagerCoordinatorRequest {
const NAME: &'static str = "ProcessManagerCoordinatorRequest";
const PACKAGE: &'static str = "angzarr";
fn full_name() -> ::prost::alloc::string::String {
"angzarr.ProcessManagerCoordinatorRequest".into()
}
fn type_url() -> ::prost::alloc::string::String {
"/angzarr.ProcessManagerCoordinatorRequest".into()
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SpeculatePmRequest {
#[prost(message, optional, tag = "1")]
pub request: ::core::option::Option<ProcessManagerHandleRequest>,
}
impl ::prost::Name for SpeculatePmRequest {
const NAME: &'static str = "SpeculatePmRequest";
const PACKAGE: &'static str = "angzarr";
fn full_name() -> ::prost::alloc::string::String {
"angzarr.SpeculatePmRequest".into()
}
fn type_url() -> ::prost::alloc::string::String {
"/angzarr.SpeculatePmRequest".into()
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ProcessManagerPrepareRequest {
#[prost(message, optional, tag = "1")]
pub trigger: ::core::option::Option<EventBook>,
#[prost(message, optional, tag = "2")]
pub process_state: ::core::option::Option<EventBook>,
}
impl ::prost::Name for ProcessManagerPrepareRequest {
const NAME: &'static str = "ProcessManagerPrepareRequest";
const PACKAGE: &'static str = "angzarr";
fn full_name() -> ::prost::alloc::string::String {
"angzarr.ProcessManagerPrepareRequest".into()
}
fn type_url() -> ::prost::alloc::string::String {
"/angzarr.ProcessManagerPrepareRequest".into()
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ProcessManagerPrepareResponse {
#[prost(message, repeated, tag = "1")]
pub destinations: ::prost::alloc::vec::Vec<Cover>,
}
impl ::prost::Name for ProcessManagerPrepareResponse {
const NAME: &'static str = "ProcessManagerPrepareResponse";
const PACKAGE: &'static str = "angzarr";
fn full_name() -> ::prost::alloc::string::String {
"angzarr.ProcessManagerPrepareResponse".into()
}
fn type_url() -> ::prost::alloc::string::String {
"/angzarr.ProcessManagerPrepareResponse".into()
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ProcessManagerHandleRequest {
#[prost(message, optional, tag = "1")]
pub trigger: ::core::option::Option<EventBook>,
#[prost(message, optional, tag = "2")]
pub process_state: ::core::option::Option<EventBook>,
#[prost(message, repeated, tag = "3")]
pub destinations: ::prost::alloc::vec::Vec<EventBook>,
}
impl ::prost::Name for ProcessManagerHandleRequest {
const NAME: &'static str = "ProcessManagerHandleRequest";
const PACKAGE: &'static str = "angzarr";
fn full_name() -> ::prost::alloc::string::String {
"angzarr.ProcessManagerHandleRequest".into()
}
fn type_url() -> ::prost::alloc::string::String {
"/angzarr.ProcessManagerHandleRequest".into()
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ProcessManagerHandleResponse {
#[prost(message, optional, tag = "1")]
pub process_events: ::core::option::Option<EventBook>,
#[prost(message, repeated, tag = "2")]
pub commands: ::prost::alloc::vec::Vec<CommandBook>,
#[prost(message, repeated, tag = "3")]
pub facts: ::prost::alloc::vec::Vec<EventBook>,
}
impl ::prost::Name for ProcessManagerHandleResponse {
const NAME: &'static str = "ProcessManagerHandleResponse";
const PACKAGE: &'static str = "angzarr";
fn full_name() -> ::prost::alloc::string::String {
"angzarr.ProcessManagerHandleResponse".into()
}
fn type_url() -> ::prost::alloc::string::String {
"/angzarr.ProcessManagerHandleResponse".into()
}
}
pub mod process_manager_service_client {
#![allow(
unused_variables,
dead_code,
missing_docs,
clippy::wildcard_imports,
clippy::let_unit_value
)]
use tonic::codegen::http::Uri;
use tonic::codegen::*;
#[derive(Debug, Clone)]
pub struct ProcessManagerServiceClient<T> {
inner: tonic::client::Grpc<T>,
}
impl ProcessManagerServiceClient<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> ProcessManagerServiceClient<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,
) -> ProcessManagerServiceClient<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,
{
ProcessManagerServiceClient::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 prepare(
&mut self,
request: impl tonic::IntoRequest<super::ProcessManagerPrepareRequest>,
) -> std::result::Result<tonic::Response<super::ProcessManagerPrepareResponse>, 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("/angzarr.ProcessManagerService/Prepare");
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("angzarr.ProcessManagerService", "Prepare"));
self.inner.unary(req, path, codec).await
}
pub async fn handle(
&mut self,
request: impl tonic::IntoRequest<super::ProcessManagerHandleRequest>,
) -> std::result::Result<tonic::Response<super::ProcessManagerHandleResponse>, 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("/angzarr.ProcessManagerService/Handle");
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("angzarr.ProcessManagerService", "Handle"));
self.inner.unary(req, path, codec).await
}
}
}
pub mod process_manager_coordinator_service_client {
#![allow(
unused_variables,
dead_code,
missing_docs,
clippy::wildcard_imports,
clippy::let_unit_value
)]
use tonic::codegen::http::Uri;
use tonic::codegen::*;
#[derive(Debug, Clone)]
pub struct ProcessManagerCoordinatorServiceClient<T> {
inner: tonic::client::Grpc<T>,
}
impl ProcessManagerCoordinatorServiceClient<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> ProcessManagerCoordinatorServiceClient<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,
) -> ProcessManagerCoordinatorServiceClient<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,
{
ProcessManagerCoordinatorServiceClient::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 handle(
&mut self,
request: impl tonic::IntoRequest<super::ProcessManagerCoordinatorRequest>,
) -> std::result::Result<tonic::Response<super::ProcessManagerHandleResponse>, 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(
"/angzarr.ProcessManagerCoordinatorService/Handle",
);
let mut req = request.into_request();
req.extensions_mut().insert(GrpcMethod::new(
"angzarr.ProcessManagerCoordinatorService",
"Handle",
));
self.inner.unary(req, path, codec).await
}
pub async fn handle_speculative(
&mut self,
request: impl tonic::IntoRequest<super::SpeculatePmRequest>,
) -> std::result::Result<tonic::Response<super::ProcessManagerHandleResponse>, 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(
"/angzarr.ProcessManagerCoordinatorService/HandleSpeculative",
);
let mut req = request.into_request();
req.extensions_mut().insert(GrpcMethod::new(
"angzarr.ProcessManagerCoordinatorService",
"HandleSpeculative",
));
self.inner.unary(req, path, codec).await
}
}
}
pub mod process_manager_service_server {
#![allow(
unused_variables,
dead_code,
missing_docs,
clippy::wildcard_imports,
clippy::let_unit_value
)]
use tonic::codegen::*;
#[async_trait]
pub trait ProcessManagerService: std::marker::Send + std::marker::Sync + 'static {
async fn prepare(
&self,
request: tonic::Request<super::ProcessManagerPrepareRequest>,
) -> std::result::Result<tonic::Response<super::ProcessManagerPrepareResponse>, tonic::Status>;
async fn handle(
&self,
request: tonic::Request<super::ProcessManagerHandleRequest>,
) -> std::result::Result<tonic::Response<super::ProcessManagerHandleResponse>, tonic::Status>;
}
#[derive(Debug)]
pub struct ProcessManagerServiceServer<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> ProcessManagerServiceServer<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 ProcessManagerServiceServer<T>
where
T: ProcessManagerService,
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() {
"/angzarr.ProcessManagerService/Prepare" => {
#[allow(non_camel_case_types)]
struct PrepareSvc<T: ProcessManagerService>(pub Arc<T>);
impl<T: ProcessManagerService>
tonic::server::UnaryService<super::ProcessManagerPrepareRequest>
for PrepareSvc<T>
{
type Response = super::ProcessManagerPrepareResponse;
type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>;
fn call(
&mut self,
request: tonic::Request<super::ProcessManagerPrepareRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as ProcessManagerService>::prepare(&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 = PrepareSvc(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)
}
"/angzarr.ProcessManagerService/Handle" => {
#[allow(non_camel_case_types)]
struct HandleSvc<T: ProcessManagerService>(pub Arc<T>);
impl<T: ProcessManagerService>
tonic::server::UnaryService<super::ProcessManagerHandleRequest>
for HandleSvc<T>
{
type Response = super::ProcessManagerHandleResponse;
type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>;
fn call(
&mut self,
request: tonic::Request<super::ProcessManagerHandleRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as ProcessManagerService>::handle(&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 = HandleSvc(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 ProcessManagerServiceServer<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 = "angzarr.ProcessManagerService";
impl<T> tonic::server::NamedService for ProcessManagerServiceServer<T> {
const NAME: &'static str = SERVICE_NAME;
}
}
pub mod process_manager_coordinator_service_server {
#![allow(
unused_variables,
dead_code,
missing_docs,
clippy::wildcard_imports,
clippy::let_unit_value
)]
use tonic::codegen::*;
#[async_trait]
pub trait ProcessManagerCoordinatorService:
std::marker::Send + std::marker::Sync + 'static
{
async fn handle(
&self,
request: tonic::Request<super::ProcessManagerCoordinatorRequest>,
) -> std::result::Result<tonic::Response<super::ProcessManagerHandleResponse>, tonic::Status>;
async fn handle_speculative(
&self,
request: tonic::Request<super::SpeculatePmRequest>,
) -> std::result::Result<tonic::Response<super::ProcessManagerHandleResponse>, tonic::Status>;
}
#[derive(Debug)]
pub struct ProcessManagerCoordinatorServiceServer<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> ProcessManagerCoordinatorServiceServer<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 ProcessManagerCoordinatorServiceServer<T>
where
T: ProcessManagerCoordinatorService,
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() {
"/angzarr.ProcessManagerCoordinatorService/Handle" => {
#[allow(non_camel_case_types)]
struct HandleSvc<T: ProcessManagerCoordinatorService>(pub Arc<T>);
impl<T: ProcessManagerCoordinatorService>
tonic::server::UnaryService<super::ProcessManagerCoordinatorRequest>
for HandleSvc<T>
{
type Response = super::ProcessManagerHandleResponse;
type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>;
fn call(
&mut self,
request: tonic::Request<super::ProcessManagerCoordinatorRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as ProcessManagerCoordinatorService>::handle(&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 = HandleSvc(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)
}
"/angzarr.ProcessManagerCoordinatorService/HandleSpeculative" => {
#[allow(non_camel_case_types)]
struct HandleSpeculativeSvc<T: ProcessManagerCoordinatorService>(pub Arc<T>);
impl<T: ProcessManagerCoordinatorService>
tonic::server::UnaryService<super::SpeculatePmRequest>
for HandleSpeculativeSvc<T>
{
type Response = super::ProcessManagerHandleResponse;
type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>;
fn call(
&mut self,
request: tonic::Request<super::SpeculatePmRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as ProcessManagerCoordinatorService>::handle_speculative(
&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 = HandleSpeculativeSvc(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 ProcessManagerCoordinatorServiceServer<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 = "angzarr.ProcessManagerCoordinatorService";
impl<T> tonic::server::NamedService for ProcessManagerCoordinatorServiceServer<T> {
const NAME: &'static str = SERVICE_NAME;
}
}
pub mod event_query_service_client {
#![allow(
unused_variables,
dead_code,
missing_docs,
clippy::wildcard_imports,
clippy::let_unit_value
)]
use tonic::codegen::http::Uri;
use tonic::codegen::*;
#[derive(Debug, Clone)]
pub struct EventQueryServiceClient<T> {
inner: tonic::client::Grpc<T>,
}
impl EventQueryServiceClient<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> EventQueryServiceClient<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,
) -> EventQueryServiceClient<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,
{
EventQueryServiceClient::new(InterceptedService::new(inner, interceptor))
}
#[must_use]
pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.inner = self.inner.send_compressed(encoding);
self
}
#[must_use]
pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.inner = self.inner.accept_compressed(encoding);
self
}
#[must_use]
pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
self.inner = self.inner.max_decoding_message_size(limit);
self
}
#[must_use]
pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
self.inner = self.inner.max_encoding_message_size(limit);
self
}
pub async fn get_event_book(
&mut self,
request: impl tonic::IntoRequest<super::Query>,
) -> std::result::Result<tonic::Response<super::EventBook>, 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("/angzarr.EventQueryService/GetEventBook");
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("angzarr.EventQueryService", "GetEventBook"));
self.inner.unary(req, path, codec).await
}
pub async fn get_events(
&mut self,
request: impl tonic::IntoRequest<super::Query>,
) -> std::result::Result<
tonic::Response<tonic::codec::Streaming<super::EventBook>>,
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("/angzarr.EventQueryService/GetEvents");
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("angzarr.EventQueryService", "GetEvents"));
self.inner.server_streaming(req, path, codec).await
}
pub async fn synchronize(
&mut self,
request: impl tonic::IntoStreamingRequest<Message = super::Query>,
) -> std::result::Result<
tonic::Response<tonic::codec::Streaming<super::EventBook>>,
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("/angzarr.EventQueryService/Synchronize");
let mut req = request.into_streaming_request();
req.extensions_mut()
.insert(GrpcMethod::new("angzarr.EventQueryService", "Synchronize"));
self.inner.streaming(req, path, codec).await
}
pub async fn get_aggregate_roots(
&mut self,
request: impl tonic::IntoRequest<()>,
) -> std::result::Result<
tonic::Response<tonic::codec::Streaming<super::AggregateRoot>>,
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(
"/angzarr.EventQueryService/GetAggregateRoots",
);
let mut req = request.into_request();
req.extensions_mut().insert(GrpcMethod::new(
"angzarr.EventQueryService",
"GetAggregateRoots",
));
self.inner.server_streaming(req, path, codec).await
}
}
}
pub mod event_query_service_server {
#![allow(
unused_variables,
dead_code,
missing_docs,
clippy::wildcard_imports,
clippy::let_unit_value
)]
use tonic::codegen::*;
#[async_trait]
pub trait EventQueryService: std::marker::Send + std::marker::Sync + 'static {
async fn get_event_book(
&self,
request: tonic::Request<super::Query>,
) -> std::result::Result<tonic::Response<super::EventBook>, tonic::Status>;
type GetEventsStream: tonic::codegen::tokio_stream::Stream<
Item = std::result::Result<super::EventBook, tonic::Status>,
> + std::marker::Send
+ 'static;
async fn get_events(
&self,
request: tonic::Request<super::Query>,
) -> std::result::Result<tonic::Response<Self::GetEventsStream>, tonic::Status>;
type SynchronizeStream: tonic::codegen::tokio_stream::Stream<
Item = std::result::Result<super::EventBook, tonic::Status>,
> + std::marker::Send
+ 'static;
async fn synchronize(
&self,
request: tonic::Request<tonic::Streaming<super::Query>>,
) -> std::result::Result<tonic::Response<Self::SynchronizeStream>, tonic::Status>;
type GetAggregateRootsStream: tonic::codegen::tokio_stream::Stream<
Item = std::result::Result<super::AggregateRoot, tonic::Status>,
> + std::marker::Send
+ 'static;
async fn get_aggregate_roots(
&self,
request: tonic::Request<()>,
) -> std::result::Result<tonic::Response<Self::GetAggregateRootsStream>, tonic::Status>;
}
#[derive(Debug)]
pub struct EventQueryServiceServer<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> EventQueryServiceServer<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 EventQueryServiceServer<T>
where
T: EventQueryService,
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() {
"/angzarr.EventQueryService/GetEventBook" => {
#[allow(non_camel_case_types)]
struct GetEventBookSvc<T: EventQueryService>(pub Arc<T>);
impl<T: EventQueryService> tonic::server::UnaryService<super::Query> for GetEventBookSvc<T> {
type Response = super::EventBook;
type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>;
fn call(&mut self, request: tonic::Request<super::Query>) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as EventQueryService>::get_event_book(&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 = GetEventBookSvc(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)
}
"/angzarr.EventQueryService/GetEvents" => {
#[allow(non_camel_case_types)]
struct GetEventsSvc<T: EventQueryService>(pub Arc<T>);
impl<T: EventQueryService> tonic::server::ServerStreamingService<super::Query> for GetEventsSvc<T> {
type Response = super::EventBook;
type ResponseStream = T::GetEventsStream;
type Future =
BoxFuture<tonic::Response<Self::ResponseStream>, tonic::Status>;
fn call(&mut self, request: tonic::Request<super::Query>) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as EventQueryService>::get_events(&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 = GetEventsSvc(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.server_streaming(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/angzarr.EventQueryService/Synchronize" => {
#[allow(non_camel_case_types)]
struct SynchronizeSvc<T: EventQueryService>(pub Arc<T>);
impl<T: EventQueryService> tonic::server::StreamingService<super::Query> for SynchronizeSvc<T> {
type Response = super::EventBook;
type ResponseStream = T::SynchronizeStream;
type Future =
BoxFuture<tonic::Response<Self::ResponseStream>, tonic::Status>;
fn call(
&mut self,
request: tonic::Request<tonic::Streaming<super::Query>>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as EventQueryService>::synchronize(&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 = SynchronizeSvc(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.streaming(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/angzarr.EventQueryService/GetAggregateRoots" => {
#[allow(non_camel_case_types)]
struct GetAggregateRootsSvc<T: EventQueryService>(pub Arc<T>);
impl<T: EventQueryService> tonic::server::ServerStreamingService<()> for GetAggregateRootsSvc<T> {
type Response = super::AggregateRoot;
type ResponseStream = T::GetAggregateRootsStream;
type Future =
BoxFuture<tonic::Response<Self::ResponseStream>, tonic::Status>;
fn call(&mut self, request: tonic::Request<()>) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as EventQueryService>::get_aggregate_roots(&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 = GetAggregateRootsSvc(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.server_streaming(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 EventQueryServiceServer<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 = "angzarr.EventQueryService";
impl<T> tonic::server::NamedService for EventQueryServiceServer<T> {
const NAME: &'static str = SERVICE_NAME;
}
}
pub mod event_stream_service_client {
#![allow(
unused_variables,
dead_code,
missing_docs,
clippy::wildcard_imports,
clippy::let_unit_value
)]
use tonic::codegen::http::Uri;
use tonic::codegen::*;
#[derive(Debug, Clone)]
pub struct EventStreamServiceClient<T> {
inner: tonic::client::Grpc<T>,
}
impl EventStreamServiceClient<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> EventStreamServiceClient<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,
) -> EventStreamServiceClient<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,
{
EventStreamServiceClient::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 subscribe(
&mut self,
request: impl tonic::IntoRequest<super::EventStreamFilter>,
) -> std::result::Result<
tonic::Response<tonic::codec::Streaming<super::EventBook>>,
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("/angzarr.EventStreamService/Subscribe");
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("angzarr.EventStreamService", "Subscribe"));
self.inner.server_streaming(req, path, codec).await
}
}
}
pub mod event_stream_service_server {
#![allow(
unused_variables,
dead_code,
missing_docs,
clippy::wildcard_imports,
clippy::let_unit_value
)]
use tonic::codegen::*;
#[async_trait]
pub trait EventStreamService: std::marker::Send + std::marker::Sync + 'static {
type SubscribeStream: tonic::codegen::tokio_stream::Stream<
Item = std::result::Result<super::EventBook, tonic::Status>,
> + std::marker::Send
+ 'static;
async fn subscribe(
&self,
request: tonic::Request<super::EventStreamFilter>,
) -> std::result::Result<tonic::Response<Self::SubscribeStream>, tonic::Status>;
}
#[derive(Debug)]
pub struct EventStreamServiceServer<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> EventStreamServiceServer<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 EventStreamServiceServer<T>
where
T: EventStreamService,
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() {
"/angzarr.EventStreamService/Subscribe" => {
#[allow(non_camel_case_types)]
struct SubscribeSvc<T: EventStreamService>(pub Arc<T>);
impl<T: EventStreamService>
tonic::server::ServerStreamingService<super::EventStreamFilter>
for SubscribeSvc<T>
{
type Response = super::EventBook;
type ResponseStream = T::SubscribeStream;
type Future =
BoxFuture<tonic::Response<Self::ResponseStream>, tonic::Status>;
fn call(
&mut self,
request: tonic::Request<super::EventStreamFilter>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as EventStreamService>::subscribe(&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 = SubscribeSvc(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.server_streaming(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 EventStreamServiceServer<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 = "angzarr.EventStreamService";
impl<T> tonic::server::NamedService for EventStreamServiceServer<T> {
const NAME: &'static str = SERVICE_NAME;
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct UpcastRequest {
#[prost(string, tag = "1")]
pub domain: ::prost::alloc::string::String,
#[prost(message, repeated, tag = "2")]
pub events: ::prost::alloc::vec::Vec<EventPage>,
}
impl ::prost::Name for UpcastRequest {
const NAME: &'static str = "UpcastRequest";
const PACKAGE: &'static str = "angzarr";
fn full_name() -> ::prost::alloc::string::String {
"angzarr.UpcastRequest".into()
}
fn type_url() -> ::prost::alloc::string::String {
"/angzarr.UpcastRequest".into()
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct UpcastResponse {
#[prost(message, repeated, tag = "1")]
pub events: ::prost::alloc::vec::Vec<EventPage>,
}
impl ::prost::Name for UpcastResponse {
const NAME: &'static str = "UpcastResponse";
const PACKAGE: &'static str = "angzarr";
fn full_name() -> ::prost::alloc::string::String {
"angzarr.UpcastResponse".into()
}
fn type_url() -> ::prost::alloc::string::String {
"/angzarr.UpcastResponse".into()
}
}
pub mod upcaster_service_client {
#![allow(
unused_variables,
dead_code,
missing_docs,
clippy::wildcard_imports,
clippy::let_unit_value
)]
use tonic::codegen::http::Uri;
use tonic::codegen::*;
#[derive(Debug, Clone)]
pub struct UpcasterServiceClient<T> {
inner: tonic::client::Grpc<T>,
}
impl UpcasterServiceClient<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> UpcasterServiceClient<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,
) -> UpcasterServiceClient<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,
{
UpcasterServiceClient::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 upcast(
&mut self,
request: impl tonic::IntoRequest<super::UpcastRequest>,
) -> std::result::Result<tonic::Response<super::UpcastResponse>, 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("/angzarr.UpcasterService/Upcast");
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("angzarr.UpcasterService", "Upcast"));
self.inner.unary(req, path, codec).await
}
}
}
pub mod upcaster_service_server {
#![allow(
unused_variables,
dead_code,
missing_docs,
clippy::wildcard_imports,
clippy::let_unit_value
)]
use tonic::codegen::*;
#[async_trait]
pub trait UpcasterService: std::marker::Send + std::marker::Sync + 'static {
async fn upcast(
&self,
request: tonic::Request<super::UpcastRequest>,
) -> std::result::Result<tonic::Response<super::UpcastResponse>, tonic::Status>;
}
#[derive(Debug)]
pub struct UpcasterServiceServer<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> UpcasterServiceServer<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 UpcasterServiceServer<T>
where
T: UpcasterService,
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() {
"/angzarr.UpcasterService/Upcast" => {
#[allow(non_camel_case_types)]
struct UpcastSvc<T: UpcasterService>(pub Arc<T>);
impl<T: UpcasterService> tonic::server::UnaryService<super::UpcastRequest> for UpcastSvc<T> {
type Response = super::UpcastResponse;
type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>;
fn call(
&mut self,
request: tonic::Request<super::UpcastRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as UpcasterService>::upcast(&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 = UpcastSvc(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 UpcasterServiceServer<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 = "angzarr.UpcasterService";
impl<T> tonic::server::NamedService for UpcasterServiceServer<T> {
const NAME: &'static str = SERVICE_NAME;
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DeleteEditionEvents {
#[prost(string, tag = "1")]
pub edition: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub domain: ::prost::alloc::string::String,
}
impl ::prost::Name for DeleteEditionEvents {
const NAME: &'static str = "DeleteEditionEvents";
const PACKAGE: &'static str = "angzarr";
fn full_name() -> ::prost::alloc::string::String {
"angzarr.DeleteEditionEvents".into()
}
fn type_url() -> ::prost::alloc::string::String {
"/angzarr.DeleteEditionEvents".into()
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct EditionEventsDeleted {
#[prost(string, tag = "1")]
pub edition: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub domain: ::prost::alloc::string::String,
#[prost(uint32, tag = "3")]
pub deleted_count: u32,
#[prost(string, tag = "4")]
pub deleted_at: ::prost::alloc::string::String,
}
impl ::prost::Name for EditionEventsDeleted {
const NAME: &'static str = "EditionEventsDeleted";
const PACKAGE: &'static str = "angzarr";
fn full_name() -> ::prost::alloc::string::String {
"angzarr.EditionEventsDeleted".into()
}
fn type_url() -> ::prost::alloc::string::String {
"/angzarr.EditionEventsDeleted".into()
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CloudEvent {
#[prost(string, tag = "1")]
pub r#type: ::prost::alloc::string::String,
#[prost(message, optional, tag = "2")]
pub data: ::core::option::Option<::prost_types::Any>,
#[prost(map = "string, string", tag = "3")]
pub extensions:
::std::collections::HashMap<::prost::alloc::string::String, ::prost::alloc::string::String>,
#[prost(string, optional, tag = "4")]
pub id: ::core::option::Option<::prost::alloc::string::String>,
#[prost(string, optional, tag = "5")]
pub source: ::core::option::Option<::prost::alloc::string::String>,
#[prost(string, optional, tag = "6")]
pub subject: ::core::option::Option<::prost::alloc::string::String>,
}
impl ::prost::Name for CloudEvent {
const NAME: &'static str = "CloudEvent";
const PACKAGE: &'static str = "angzarr";
fn full_name() -> ::prost::alloc::string::String {
"angzarr.CloudEvent".into()
}
fn type_url() -> ::prost::alloc::string::String {
"/angzarr.CloudEvent".into()
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CloudEventsResponse {
#[prost(message, repeated, tag = "1")]
pub events: ::prost::alloc::vec::Vec<CloudEvent>,
}
impl ::prost::Name for CloudEventsResponse {
const NAME: &'static str = "CloudEventsResponse";
const PACKAGE: &'static str = "angzarr";
fn full_name() -> ::prost::alloc::string::String {
"angzarr.CloudEventsResponse".into()
}
fn type_url() -> ::prost::alloc::string::String {
"/angzarr.CloudEventsResponse".into()
}
}