1#[derive(Clone, Copy, PartialEq, ::prost::Message)]
4pub struct AddParams {
5 #[prost(int32, tag = "1")]
7 pub a: i32,
8 #[prost(int32, tag = "2")]
10 pub b: i32,
11}
12#[derive(Clone, Copy, PartialEq, ::prost::Message)]
14pub struct AddResult {
15 #[prost(int32, tag = "1")]
17 pub r: i32,
18}
19#[derive(Clone, PartialEq, ::prost::Message)]
21pub struct AuthReq {
22 #[prost(string, tag = "1")]
24 pub guid: ::prost::alloc::string::String,
25 #[prost(string, tag = "2")]
27 pub conn_id: ::prost::alloc::string::String,
28 #[prost(int64, tag = "3")]
30 pub last_msg_id: i64,
31}
32#[derive(Clone, Copy, PartialEq, ::prost::Message)]
34pub struct AuthResp {}
35#[derive(Clone, PartialEq, ::prost::Message)]
37pub struct BroadcastFrame {
38 #[prost(message, optional, tag = "1")]
40 pub options: ::core::option::Option<FrameOption>,
41 #[prost(string, tag = "2")]
43 pub target_path: ::prost::alloc::string::String,
44 #[prost(message, optional, tag = "3")]
46 pub body: ::core::option::Option<::prost_types::Any>,
47}
48#[derive(Clone, PartialEq, ::prost::Message)]
50pub struct FrameOption {
51 #[prost(int64, tag = "1")]
53 pub message_id: i64,
54 #[prost(int64, tag = "2")]
56 pub sequence: i64,
57 #[prost(bool, tag = "3")]
59 pub is_ack: bool,
60 #[prost(message, optional, tag = "4")]
62 pub status: ::core::option::Option<super::super::rpc::Status>,
63 #[prost(string, tag = "5")]
65 pub ack_origin: ::prost::alloc::string::String,
66 #[prost(int64, tag = "6")]
68 pub timestamp: i64,
69 #[prost(int64, tag = "7")]
71 pub msg_type: i64,
72}
73#[derive(Clone, Copy, PartialEq, ::prost::Message)]
75pub struct HeartbeatReq {}
76#[derive(Clone, PartialEq, ::prost::Message)]
78pub struct HeartbeatResp {
79 #[prost(enumeration = "heartbeat_resp::OpType", tag = "1")]
81 pub op_type: i32,
82 #[prost(string, tag = "2")]
84 pub target_hostname: ::prost::alloc::string::String,
85 #[prost(string, tag = "3")]
87 pub target_ip: ::prost::alloc::string::String,
88 #[prost(int64, tag = "4")]
90 pub target_port: i64,
91 #[prost(int64, tag = "5")]
93 pub target_ttl: i64,
94}
95pub mod heartbeat_resp {
97 #[derive(
99 Clone,
100 Copy,
101 Debug,
102 PartialEq,
103 Eq,
104 Hash,
105 PartialOrd,
106 Ord,
107 ::prost::Enumeration
108 )]
109 #[repr(i32)]
110 pub enum OpType {
111 Default = 0,
113 Unhealthy = 1,
115 Migration = 2,
117 }
118 impl OpType {
119 pub fn as_str_name(&self) -> &'static str {
124 match self {
125 Self::Default => "DEFAULT",
126 Self::Unhealthy => "UNHEALTHY",
127 Self::Migration => "MIGRATION",
128 }
129 }
130 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
132 match value {
133 "DEFAULT" => Some(Self::Default),
134 "UNHEALTHY" => Some(Self::Unhealthy),
135 "MIGRATION" => Some(Self::Migration),
136 _ => None,
137 }
138 }
139 }
140}
141#[derive(Clone, PartialEq, ::prost::Message)]
143pub struct LaserLogUploadResp {
144 #[prost(int64, tag = "1")]
146 pub taskid: i64,
147 #[prost(string, tag = "2")]
149 pub date: ::prost::alloc::string::String,
150}
151#[derive(Clone, PartialEq, ::prost::Message)]
153pub struct MessageAckReq {
154 #[prost(int64, tag = "1")]
156 pub ack_id: i64,
157 #[prost(string, tag = "2")]
159 pub ack_origin: ::prost::alloc::string::String,
160 #[prost(string, tag = "3")]
162 pub target_path: ::prost::alloc::string::String,
163 #[prost(int64, tag = "4")]
165 pub msg_type: i64,
166}
167#[derive(Clone, PartialEq, ::prost::Message)]
169pub struct ModResourceResp {
170 #[prost(enumeration = "Action", tag = "1")]
172 pub atcion: i32,
173 #[prost(string, tag = "2")]
175 pub app_key: ::prost::alloc::string::String,
176 #[prost(string, tag = "3")]
178 pub pool_name: ::prost::alloc::string::String,
179 #[prost(string, tag = "4")]
181 pub module_name: ::prost::alloc::string::String,
182 #[prost(int64, tag = "5")]
184 pub module_version: i64,
185 #[prost(int64, tag = "6")]
187 pub list_version: i64,
188}
189#[derive(Clone, PartialEq, ::prost::Message)]
191pub struct PageBlackList {
192 #[prost(string, tag = "1")]
194 pub id: ::prost::alloc::string::String,
195}
196#[derive(Clone, PartialEq, ::prost::Message)]
198pub struct PageView {
199 #[prost(string, tag = "1")]
201 pub id: ::prost::alloc::string::String,
202}
203#[derive(Clone, PartialEq, ::prost::Message)]
205pub struct PushMessageResp {
206 #[prost(int64, tag = "1")]
208 pub old_taskid: i64,
209 #[prost(enumeration = "push_message_resp::Biz", tag = "2")]
211 pub biz: i32,
212 #[prost(enumeration = "push_message_resp::Type", tag = "3")]
214 pub r#type: i32,
215 #[prost(string, tag = "4")]
217 pub title: ::prost::alloc::string::String,
218 #[prost(string, tag = "5")]
220 pub summary: ::prost::alloc::string::String,
221 #[prost(string, tag = "6")]
223 pub img: ::prost::alloc::string::String,
224 #[prost(string, tag = "7")]
226 pub link: ::prost::alloc::string::String,
227 #[prost(enumeration = "push_message_resp::Position", tag = "8")]
229 pub position: i32,
230 #[prost(int32, tag = "9")]
232 pub duration: i32,
233 #[prost(int64, tag = "10")]
235 pub expire: i64,
236 #[prost(string, tag = "11")]
238 pub taskid: ::prost::alloc::string::String,
239 #[prost(message, repeated, tag = "12")]
241 pub page_black_list: ::prost::alloc::vec::Vec<PageBlackList>,
242 #[prost(message, repeated, tag = "13")]
244 pub page_view: ::prost::alloc::vec::Vec<PageView>,
245 #[prost(message, optional, tag = "14")]
247 pub target_resource: ::core::option::Option<TargetResource>,
248 #[prost(enumeration = "push_message_resp::ImageFrame", tag = "15")]
250 pub image_frame: i32,
251 #[prost(enumeration = "push_message_resp::ImageMarker", tag = "16")]
253 pub image_marker: i32,
254 #[prost(enumeration = "push_message_resp::ImagePosition", tag = "17")]
256 pub image_position: i32,
257 #[prost(int64, tag = "18")]
259 pub job: i64,
260 #[prost(string, tag = "19")]
262 pub msg_source: ::prost::alloc::string::String,
263 #[prost(bool, tag = "20")]
265 pub hide_arrow: bool,
266 #[prost(map = "string, string", tag = "21")]
268 pub metadata: ::std::collections::HashMap<
269 ::prost::alloc::string::String,
270 ::prost::alloc::string::String,
271 >,
272 #[prost(string, tag = "22")]
274 pub pure_img: ::prost::alloc::string::String,
275 #[prost(enumeration = "push_message_resp::DisplayType", tag = "23")]
277 pub display_type: i32,
278 #[prost(enumeration = "push_message_resp::PopType", tag = "24")]
280 pub pop_type: i32,
281 #[prost(int32, tag = "25")]
283 pub reserve: i32,
284 #[prost(int32, tag = "26")]
286 pub level: i32,
287 #[prost(bool, tag = "27")]
289 pub query: bool,
290 #[prost(int32, tag = "28")]
292 pub bid: i32,
293}
294pub mod push_message_resp {
296 #[derive(
298 Clone,
299 Copy,
300 Debug,
301 PartialEq,
302 Eq,
303 Hash,
304 PartialOrd,
305 Ord,
306 ::prost::Enumeration
307 )]
308 #[repr(i32)]
309 pub enum Biz {
310 Unknown = 0,
312 Video = 1,
314 Live = 2,
316 Activity = 3,
318 }
319 impl Biz {
320 pub fn as_str_name(&self) -> &'static str {
325 match self {
326 Self::Unknown => "BIZ_UNKNOWN",
327 Self::Video => "BIZ_VIDEO",
328 Self::Live => "BIZ_LIVE",
329 Self::Activity => "BIZ_ACTIVITY",
330 }
331 }
332 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
334 match value {
335 "BIZ_UNKNOWN" => Some(Self::Unknown),
336 "BIZ_VIDEO" => Some(Self::Video),
337 "BIZ_LIVE" => Some(Self::Live),
338 "BIZ_ACTIVITY" => Some(Self::Activity),
339 _ => None,
340 }
341 }
342 }
343 #[derive(
345 Clone,
346 Copy,
347 Debug,
348 PartialEq,
349 Eq,
350 Hash,
351 PartialOrd,
352 Ord,
353 ::prost::Enumeration
354 )]
355 #[repr(i32)]
356 pub enum DisplayType {
357 DisPlayText = 0,
359 DisplaySatic = 1,
361 DisplayGif = 2,
363 }
364 impl DisplayType {
365 pub fn as_str_name(&self) -> &'static str {
370 match self {
371 Self::DisPlayText => "DisPlayText",
372 Self::DisplaySatic => "DisplaySatic",
373 Self::DisplayGif => "DisplayGif",
374 }
375 }
376 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
378 match value {
379 "DisPlayText" => Some(Self::DisPlayText),
380 "DisplaySatic" => Some(Self::DisplaySatic),
381 "DisplayGif" => Some(Self::DisplayGif),
382 _ => None,
383 }
384 }
385 }
386 #[derive(
388 Clone,
389 Copy,
390 Debug,
391 PartialEq,
392 Eq,
393 Hash,
394 PartialOrd,
395 Ord,
396 ::prost::Enumeration
397 )]
398 #[repr(i32)]
399 pub enum ImageFrame {
400 FrameUnknown = 0,
402 FrameLive = 1,
404 }
405 impl ImageFrame {
406 pub fn as_str_name(&self) -> &'static str {
411 match self {
412 Self::FrameUnknown => "FRAME_UNKNOWN",
413 Self::FrameLive => "FRAME_LIVE",
414 }
415 }
416 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
418 match value {
419 "FRAME_UNKNOWN" => Some(Self::FrameUnknown),
420 "FRAME_LIVE" => Some(Self::FrameLive),
421 _ => None,
422 }
423 }
424 }
425 #[derive(
427 Clone,
428 Copy,
429 Debug,
430 PartialEq,
431 Eq,
432 Hash,
433 PartialOrd,
434 Ord,
435 ::prost::Enumeration
436 )]
437 #[repr(i32)]
438 pub enum ImageMarker {
439 MarkerUnknown = 0,
441 MarkerLive = 1,
443 }
444 impl ImageMarker {
445 pub fn as_str_name(&self) -> &'static str {
450 match self {
451 Self::MarkerUnknown => "MARKER_UNKNOWN",
452 Self::MarkerLive => "MARKER_LIVE",
453 }
454 }
455 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
457 match value {
458 "MARKER_UNKNOWN" => Some(Self::MarkerUnknown),
459 "MARKER_LIVE" => Some(Self::MarkerLive),
460 _ => None,
461 }
462 }
463 }
464 #[derive(
466 Clone,
467 Copy,
468 Debug,
469 PartialEq,
470 Eq,
471 Hash,
472 PartialOrd,
473 Ord,
474 ::prost::Enumeration
475 )]
476 #[repr(i32)]
477 pub enum ImagePosition {
478 ImagePosUnknown = 0,
480 ImagePosLeft = 1,
482 ImagePosRight = 2,
484 }
485 impl ImagePosition {
486 pub fn as_str_name(&self) -> &'static str {
491 match self {
492 Self::ImagePosUnknown => "IMAGE_POS_UNKNOWN",
493 Self::ImagePosLeft => "IMAGE_POS_LEFT",
494 Self::ImagePosRight => "IMAGE_POS_RIGHT",
495 }
496 }
497 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
499 match value {
500 "IMAGE_POS_UNKNOWN" => Some(Self::ImagePosUnknown),
501 "IMAGE_POS_LEFT" => Some(Self::ImagePosLeft),
502 "IMAGE_POS_RIGHT" => Some(Self::ImagePosRight),
503 _ => None,
504 }
505 }
506 }
507 #[derive(
509 Clone,
510 Copy,
511 Debug,
512 PartialEq,
513 Eq,
514 Hash,
515 PartialOrd,
516 Ord,
517 ::prost::Enumeration
518 )]
519 #[repr(i32)]
520 pub enum PopType {
521 TopToBottom = 0,
523 RightToLeft = 1,
525 }
526 impl PopType {
527 pub fn as_str_name(&self) -> &'static str {
532 match self {
533 Self::TopToBottom => "TopToBottom",
534 Self::RightToLeft => "RightToLeft",
535 }
536 }
537 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
539 match value {
540 "TopToBottom" => Some(Self::TopToBottom),
541 "RightToLeft" => Some(Self::RightToLeft),
542 _ => None,
543 }
544 }
545 }
546 #[derive(
548 Clone,
549 Copy,
550 Debug,
551 PartialEq,
552 Eq,
553 Hash,
554 PartialOrd,
555 Ord,
556 ::prost::Enumeration
557 )]
558 #[repr(i32)]
559 pub enum Position {
560 PosUnknown = 0,
562 PosTop = 1,
564 }
565 impl Position {
566 pub fn as_str_name(&self) -> &'static str {
571 match self {
572 Self::PosUnknown => "POS_UNKNOWN",
573 Self::PosTop => "POS_TOP",
574 }
575 }
576 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
578 match value {
579 "POS_UNKNOWN" => Some(Self::PosUnknown),
580 "POS_TOP" => Some(Self::PosTop),
581 _ => None,
582 }
583 }
584 }
585 #[derive(
587 Clone,
588 Copy,
589 Debug,
590 PartialEq,
591 Eq,
592 Hash,
593 PartialOrd,
594 Ord,
595 ::prost::Enumeration
596 )]
597 #[repr(i32)]
598 pub enum Type {
599 Unknown = 0,
601 Default = 1,
603 Hot = 2,
605 Realtime = 3,
607 Recommend = 4,
609 }
610 impl Type {
611 pub fn as_str_name(&self) -> &'static str {
616 match self {
617 Self::Unknown => "TYPE_UNKNOWN",
618 Self::Default => "TYPE_DEFAULT",
619 Self::Hot => "TYPE_HOT",
620 Self::Realtime => "TYPE_REALTIME",
621 Self::Recommend => "TYPE_RECOMMEND",
622 }
623 }
624 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
626 match value {
627 "TYPE_UNKNOWN" => Some(Self::Unknown),
628 "TYPE_DEFAULT" => Some(Self::Default),
629 "TYPE_HOT" => Some(Self::Hot),
630 "TYPE_REALTIME" => Some(Self::Realtime),
631 "TYPE_RECOMMEND" => Some(Self::Recommend),
632 _ => None,
633 }
634 }
635 }
636}
637#[derive(Clone, PartialEq, ::prost::Message)]
639pub struct RoomErrorEvent {
640 #[prost(message, optional, tag = "1")]
642 pub status: ::core::option::Option<super::super::rpc::Status>,
643}
644#[derive(Clone, Copy, PartialEq, ::prost::Message)]
646pub struct RoomJoinEvent {}
647#[derive(Clone, Copy, PartialEq, ::prost::Message)]
649pub struct RoomLeaveEvent {}
650#[derive(Clone, PartialEq, ::prost::Message)]
652pub struct RoomMessageEvent {
653 #[prost(string, tag = "1")]
655 pub target_path: ::prost::alloc::string::String,
656 #[prost(message, optional, tag = "2")]
658 pub body: ::core::option::Option<::prost_types::Any>,
659}
660#[derive(Clone, Copy, PartialEq, ::prost::Message)]
662pub struct RoomOnlineEvent {
663 #[prost(int32, tag = "1")]
665 pub online: i32,
666 #[prost(int32, tag = "2")]
668 pub all_online: i32,
669}
670#[derive(Clone, PartialEq, ::prost::Message)]
672pub struct RoomReq {
673 #[prost(string, tag = "1")]
675 pub id: ::prost::alloc::string::String,
676 #[prost(oneof = "room_req::Event", tags = "2, 3, 4, 5")]
678 pub event: ::core::option::Option<room_req::Event>,
679}
680pub mod room_req {
682 #[derive(Clone, PartialEq, ::prost::Oneof)]
684 pub enum Event {
685 #[prost(message, tag = "2")]
687 Join(super::RoomJoinEvent),
688 #[prost(message, tag = "3")]
690 Leave(super::RoomLeaveEvent),
691 #[prost(message, tag = "4")]
693 Online(super::RoomOnlineEvent),
694 #[prost(message, tag = "5")]
696 Msg(super::RoomMessageEvent),
697 }
698}
699#[derive(Clone, PartialEq, ::prost::Message)]
701pub struct RoomResp {
702 #[prost(string, tag = "1")]
704 pub id: ::prost::alloc::string::String,
705 #[prost(oneof = "room_resp::Event", tags = "2, 3, 4, 5, 6")]
707 pub event: ::core::option::Option<room_resp::Event>,
708}
709pub mod room_resp {
711 #[derive(Clone, PartialEq, ::prost::Oneof)]
713 pub enum Event {
714 #[prost(message, tag = "2")]
716 Join(super::RoomJoinEvent),
717 #[prost(message, tag = "3")]
719 Leave(super::RoomLeaveEvent),
720 #[prost(message, tag = "4")]
722 Online(super::RoomOnlineEvent),
723 #[prost(message, tag = "5")]
725 Msg(super::RoomMessageEvent),
726 #[prost(message, tag = "6")]
728 Err(super::RoomErrorEvent),
729 }
730}
731#[derive(Clone, PartialEq, ::prost::Message)]
733pub struct TargetPath {
734 #[prost(string, repeated, tag = "1")]
736 pub target_paths: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
737}
738#[derive(Clone, PartialEq, ::prost::Message)]
740pub struct TargetResource {
741 #[prost(enumeration = "LinkType", tag = "1")]
743 pub r#type: i32,
744 #[prost(map = "string, string", tag = "2")]
746 pub resource: ::std::collections::HashMap<
747 ::prost::alloc::string::String,
748 ::prost::alloc::string::String,
749 >,
750}
751#[derive(Clone, PartialEq, ::prost::Message)]
753pub struct TestResp {
754 #[prost(int64, tag = "1")]
756 pub taskid: i64,
757 #[prost(int64, tag = "2")]
759 pub timestamp: i64,
760 #[prost(string, tag = "3")]
762 pub message: ::prost::alloc::string::String,
763 #[prost(message, optional, tag = "4")]
765 pub extra: ::core::option::Option<::prost_types::Any>,
766}
767#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
769#[repr(i32)]
770pub enum Action {
771 Unknown = 0,
773 Update = 1,
775 Delete = 2,
777}
778impl Action {
779 pub fn as_str_name(&self) -> &'static str {
784 match self {
785 Self::Unknown => "UNKNOWN",
786 Self::Update => "UPDATE",
787 Self::Delete => "DELETE",
788 }
789 }
790 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
792 match value {
793 "UNKNOWN" => Some(Self::Unknown),
794 "UPDATE" => Some(Self::Update),
795 "DELETE" => Some(Self::Delete),
796 _ => None,
797 }
798 }
799}
800#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
802#[repr(i32)]
803pub enum LinkType {
804 Unknown = 0,
806 Bangumi = 1,
808 Video = 2,
810 Live = 3,
812}
813impl LinkType {
814 pub fn as_str_name(&self) -> &'static str {
819 match self {
820 Self::Unknown => "LINK_TYPE_UNKNOWN",
821 Self::Bangumi => "LINK_TYPE_BANGUMI",
822 Self::Video => "LINK_TYPE_VIDEO",
823 Self::Live => "LINK_TYPE_LIVE",
824 }
825 }
826 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
828 match value {
829 "LINK_TYPE_UNKNOWN" => Some(Self::Unknown),
830 "LINK_TYPE_BANGUMI" => Some(Self::Bangumi),
831 "LINK_TYPE_VIDEO" => Some(Self::Video),
832 "LINK_TYPE_LIVE" => Some(Self::Live),
833 _ => None,
834 }
835 }
836}
837pub mod broadcast_room_client {
839 #![allow(
840 unused_variables,
841 dead_code,
842 missing_docs,
843 clippy::wildcard_imports,
844 clippy::let_unit_value,
845 )]
846 use tonic::codegen::*;
847 use tonic::codegen::http::Uri;
848 #[derive(Debug, Clone)]
850 pub struct BroadcastRoomClient<T> {
851 inner: tonic::client::Grpc<T>,
852 }
853 impl<T> BroadcastRoomClient<T>
854 where
855 T: tonic::client::GrpcService<tonic::body::BoxBody>,
856 T::Error: Into<StdError>,
857 T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
858 <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
859 {
860 pub fn new(inner: T) -> Self {
861 let inner = tonic::client::Grpc::new(inner);
862 Self { inner }
863 }
864 pub fn with_origin(inner: T, origin: Uri) -> Self {
865 let inner = tonic::client::Grpc::with_origin(inner, origin);
866 Self { inner }
867 }
868 pub fn with_interceptor<F>(
869 inner: T,
870 interceptor: F,
871 ) -> BroadcastRoomClient<InterceptedService<T, F>>
872 where
873 F: tonic::service::Interceptor,
874 T::ResponseBody: Default,
875 T: tonic::codegen::Service<
876 http::Request<tonic::body::BoxBody>,
877 Response = http::Response<
878 <T as tonic::client::GrpcService<tonic::body::BoxBody>>::ResponseBody,
879 >,
880 >,
881 <T as tonic::codegen::Service<
882 http::Request<tonic::body::BoxBody>,
883 >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
884 {
885 BroadcastRoomClient::new(InterceptedService::new(inner, interceptor))
886 }
887 #[must_use]
892 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
893 self.inner = self.inner.send_compressed(encoding);
894 self
895 }
896 #[must_use]
898 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
899 self.inner = self.inner.accept_compressed(encoding);
900 self
901 }
902 #[must_use]
906 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
907 self.inner = self.inner.max_decoding_message_size(limit);
908 self
909 }
910 #[must_use]
914 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
915 self.inner = self.inner.max_encoding_message_size(limit);
916 self
917 }
918 pub async fn enter(
920 &mut self,
921 request: impl tonic::IntoRequest<super::RoomReq>,
922 ) -> std::result::Result<tonic::Response<super::RoomResp>, tonic::Status> {
923 self.inner
924 .ready()
925 .await
926 .map_err(|e| {
927 tonic::Status::unknown(
928 format!("Service was not ready: {}", e.into()),
929 )
930 })?;
931 let codec = tonic::codec::ProstCodec::default();
932 let path = http::uri::PathAndQuery::from_static(
933 "/bilibili.broadcast.v1.BroadcastRoom/Enter",
934 );
935 let mut req = request.into_request();
936 req.extensions_mut()
937 .insert(GrpcMethod::new("bilibili.broadcast.v1.BroadcastRoom", "Enter"));
938 self.inner.unary(req, path, codec).await
939 }
940 }
941}
942pub mod laser_client {
944 #![allow(
945 unused_variables,
946 dead_code,
947 missing_docs,
948 clippy::wildcard_imports,
949 clippy::let_unit_value,
950 )]
951 use tonic::codegen::*;
952 use tonic::codegen::http::Uri;
953 #[derive(Debug, Clone)]
955 pub struct LaserClient<T> {
956 inner: tonic::client::Grpc<T>,
957 }
958 impl<T> LaserClient<T>
959 where
960 T: tonic::client::GrpcService<tonic::body::BoxBody>,
961 T::Error: Into<StdError>,
962 T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
963 <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
964 {
965 pub fn new(inner: T) -> Self {
966 let inner = tonic::client::Grpc::new(inner);
967 Self { inner }
968 }
969 pub fn with_origin(inner: T, origin: Uri) -> Self {
970 let inner = tonic::client::Grpc::with_origin(inner, origin);
971 Self { inner }
972 }
973 pub fn with_interceptor<F>(
974 inner: T,
975 interceptor: F,
976 ) -> LaserClient<InterceptedService<T, F>>
977 where
978 F: tonic::service::Interceptor,
979 T::ResponseBody: Default,
980 T: tonic::codegen::Service<
981 http::Request<tonic::body::BoxBody>,
982 Response = http::Response<
983 <T as tonic::client::GrpcService<tonic::body::BoxBody>>::ResponseBody,
984 >,
985 >,
986 <T as tonic::codegen::Service<
987 http::Request<tonic::body::BoxBody>,
988 >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
989 {
990 LaserClient::new(InterceptedService::new(inner, interceptor))
991 }
992 #[must_use]
997 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
998 self.inner = self.inner.send_compressed(encoding);
999 self
1000 }
1001 #[must_use]
1003 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
1004 self.inner = self.inner.accept_compressed(encoding);
1005 self
1006 }
1007 #[must_use]
1011 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
1012 self.inner = self.inner.max_decoding_message_size(limit);
1013 self
1014 }
1015 #[must_use]
1019 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
1020 self.inner = self.inner.max_encoding_message_size(limit);
1021 self
1022 }
1023 pub async fn watch_log_upload_event(
1025 &mut self,
1026 request: impl tonic::IntoRequest<()>,
1027 ) -> std::result::Result<
1028 tonic::Response<super::LaserLogUploadResp>,
1029 tonic::Status,
1030 > {
1031 self.inner
1032 .ready()
1033 .await
1034 .map_err(|e| {
1035 tonic::Status::unknown(
1036 format!("Service was not ready: {}", e.into()),
1037 )
1038 })?;
1039 let codec = tonic::codec::ProstCodec::default();
1040 let path = http::uri::PathAndQuery::from_static(
1041 "/bilibili.broadcast.v1.Laser/WatchLogUploadEvent",
1042 );
1043 let mut req = request.into_request();
1044 req.extensions_mut()
1045 .insert(
1046 GrpcMethod::new("bilibili.broadcast.v1.Laser", "WatchLogUploadEvent"),
1047 );
1048 self.inner.unary(req, path, codec).await
1049 }
1050 }
1051}
1052pub mod mod_manager_client {
1054 #![allow(
1055 unused_variables,
1056 dead_code,
1057 missing_docs,
1058 clippy::wildcard_imports,
1059 clippy::let_unit_value,
1060 )]
1061 use tonic::codegen::*;
1062 use tonic::codegen::http::Uri;
1063 #[derive(Debug, Clone)]
1065 pub struct ModManagerClient<T> {
1066 inner: tonic::client::Grpc<T>,
1067 }
1068 impl<T> ModManagerClient<T>
1069 where
1070 T: tonic::client::GrpcService<tonic::body::BoxBody>,
1071 T::Error: Into<StdError>,
1072 T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
1073 <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
1074 {
1075 pub fn new(inner: T) -> Self {
1076 let inner = tonic::client::Grpc::new(inner);
1077 Self { inner }
1078 }
1079 pub fn with_origin(inner: T, origin: Uri) -> Self {
1080 let inner = tonic::client::Grpc::with_origin(inner, origin);
1081 Self { inner }
1082 }
1083 pub fn with_interceptor<F>(
1084 inner: T,
1085 interceptor: F,
1086 ) -> ModManagerClient<InterceptedService<T, F>>
1087 where
1088 F: tonic::service::Interceptor,
1089 T::ResponseBody: Default,
1090 T: tonic::codegen::Service<
1091 http::Request<tonic::body::BoxBody>,
1092 Response = http::Response<
1093 <T as tonic::client::GrpcService<tonic::body::BoxBody>>::ResponseBody,
1094 >,
1095 >,
1096 <T as tonic::codegen::Service<
1097 http::Request<tonic::body::BoxBody>,
1098 >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
1099 {
1100 ModManagerClient::new(InterceptedService::new(inner, interceptor))
1101 }
1102 #[must_use]
1107 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
1108 self.inner = self.inner.send_compressed(encoding);
1109 self
1110 }
1111 #[must_use]
1113 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
1114 self.inner = self.inner.accept_compressed(encoding);
1115 self
1116 }
1117 #[must_use]
1121 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
1122 self.inner = self.inner.max_decoding_message_size(limit);
1123 self
1124 }
1125 #[must_use]
1129 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
1130 self.inner = self.inner.max_encoding_message_size(limit);
1131 self
1132 }
1133 pub async fn watch_resource(
1135 &mut self,
1136 request: impl tonic::IntoRequest<()>,
1137 ) -> std::result::Result<
1138 tonic::Response<super::ModResourceResp>,
1139 tonic::Status,
1140 > {
1141 self.inner
1142 .ready()
1143 .await
1144 .map_err(|e| {
1145 tonic::Status::unknown(
1146 format!("Service was not ready: {}", e.into()),
1147 )
1148 })?;
1149 let codec = tonic::codec::ProstCodec::default();
1150 let path = http::uri::PathAndQuery::from_static(
1151 "/bilibili.broadcast.v1.ModManager/WatchResource",
1152 );
1153 let mut req = request.into_request();
1154 req.extensions_mut()
1155 .insert(
1156 GrpcMethod::new("bilibili.broadcast.v1.ModManager", "WatchResource"),
1157 );
1158 self.inner.unary(req, path, codec).await
1159 }
1160 }
1161}
1162pub mod push_client {
1164 #![allow(
1165 unused_variables,
1166 dead_code,
1167 missing_docs,
1168 clippy::wildcard_imports,
1169 clippy::let_unit_value,
1170 )]
1171 use tonic::codegen::*;
1172 use tonic::codegen::http::Uri;
1173 #[derive(Debug, Clone)]
1175 pub struct PushClient<T> {
1176 inner: tonic::client::Grpc<T>,
1177 }
1178 impl<T> PushClient<T>
1179 where
1180 T: tonic::client::GrpcService<tonic::body::BoxBody>,
1181 T::Error: Into<StdError>,
1182 T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
1183 <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
1184 {
1185 pub fn new(inner: T) -> Self {
1186 let inner = tonic::client::Grpc::new(inner);
1187 Self { inner }
1188 }
1189 pub fn with_origin(inner: T, origin: Uri) -> Self {
1190 let inner = tonic::client::Grpc::with_origin(inner, origin);
1191 Self { inner }
1192 }
1193 pub fn with_interceptor<F>(
1194 inner: T,
1195 interceptor: F,
1196 ) -> PushClient<InterceptedService<T, F>>
1197 where
1198 F: tonic::service::Interceptor,
1199 T::ResponseBody: Default,
1200 T: tonic::codegen::Service<
1201 http::Request<tonic::body::BoxBody>,
1202 Response = http::Response<
1203 <T as tonic::client::GrpcService<tonic::body::BoxBody>>::ResponseBody,
1204 >,
1205 >,
1206 <T as tonic::codegen::Service<
1207 http::Request<tonic::body::BoxBody>,
1208 >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
1209 {
1210 PushClient::new(InterceptedService::new(inner, interceptor))
1211 }
1212 #[must_use]
1217 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
1218 self.inner = self.inner.send_compressed(encoding);
1219 self
1220 }
1221 #[must_use]
1223 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
1224 self.inner = self.inner.accept_compressed(encoding);
1225 self
1226 }
1227 #[must_use]
1231 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
1232 self.inner = self.inner.max_decoding_message_size(limit);
1233 self
1234 }
1235 #[must_use]
1239 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
1240 self.inner = self.inner.max_encoding_message_size(limit);
1241 self
1242 }
1243 pub async fn watch_message(
1245 &mut self,
1246 request: impl tonic::IntoRequest<()>,
1247 ) -> std::result::Result<
1248 tonic::Response<super::PushMessageResp>,
1249 tonic::Status,
1250 > {
1251 self.inner
1252 .ready()
1253 .await
1254 .map_err(|e| {
1255 tonic::Status::unknown(
1256 format!("Service was not ready: {}", e.into()),
1257 )
1258 })?;
1259 let codec = tonic::codec::ProstCodec::default();
1260 let path = http::uri::PathAndQuery::from_static(
1261 "/bilibili.broadcast.v1.Push/WatchMessage",
1262 );
1263 let mut req = request.into_request();
1264 req.extensions_mut()
1265 .insert(GrpcMethod::new("bilibili.broadcast.v1.Push", "WatchMessage"));
1266 self.inner.unary(req, path, codec).await
1267 }
1268 }
1269}
1270pub mod test2_client {
1272 #![allow(
1273 unused_variables,
1274 dead_code,
1275 missing_docs,
1276 clippy::wildcard_imports,
1277 clippy::let_unit_value,
1278 )]
1279 use tonic::codegen::*;
1280 use tonic::codegen::http::Uri;
1281 #[derive(Debug, Clone)]
1283 pub struct Test2Client<T> {
1284 inner: tonic::client::Grpc<T>,
1285 }
1286 impl<T> Test2Client<T>
1287 where
1288 T: tonic::client::GrpcService<tonic::body::BoxBody>,
1289 T::Error: Into<StdError>,
1290 T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
1291 <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
1292 {
1293 pub fn new(inner: T) -> Self {
1294 let inner = tonic::client::Grpc::new(inner);
1295 Self { inner }
1296 }
1297 pub fn with_origin(inner: T, origin: Uri) -> Self {
1298 let inner = tonic::client::Grpc::with_origin(inner, origin);
1299 Self { inner }
1300 }
1301 pub fn with_interceptor<F>(
1302 inner: T,
1303 interceptor: F,
1304 ) -> Test2Client<InterceptedService<T, F>>
1305 where
1306 F: tonic::service::Interceptor,
1307 T::ResponseBody: Default,
1308 T: tonic::codegen::Service<
1309 http::Request<tonic::body::BoxBody>,
1310 Response = http::Response<
1311 <T as tonic::client::GrpcService<tonic::body::BoxBody>>::ResponseBody,
1312 >,
1313 >,
1314 <T as tonic::codegen::Service<
1315 http::Request<tonic::body::BoxBody>,
1316 >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
1317 {
1318 Test2Client::new(InterceptedService::new(inner, interceptor))
1319 }
1320 #[must_use]
1325 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
1326 self.inner = self.inner.send_compressed(encoding);
1327 self
1328 }
1329 #[must_use]
1331 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
1332 self.inner = self.inner.accept_compressed(encoding);
1333 self
1334 }
1335 #[must_use]
1339 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
1340 self.inner = self.inner.max_decoding_message_size(limit);
1341 self
1342 }
1343 #[must_use]
1347 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
1348 self.inner = self.inner.max_encoding_message_size(limit);
1349 self
1350 }
1351 pub async fn test(
1353 &mut self,
1354 request: impl tonic::IntoRequest<super::AddParams>,
1355 ) -> std::result::Result<tonic::Response<()>, tonic::Status> {
1356 self.inner
1357 .ready()
1358 .await
1359 .map_err(|e| {
1360 tonic::Status::unknown(
1361 format!("Service was not ready: {}", e.into()),
1362 )
1363 })?;
1364 let codec = tonic::codec::ProstCodec::default();
1365 let path = http::uri::PathAndQuery::from_static(
1366 "/bilibili.broadcast.v1.Test2/Test",
1367 );
1368 let mut req = request.into_request();
1369 req.extensions_mut()
1370 .insert(GrpcMethod::new("bilibili.broadcast.v1.Test2", "Test"));
1371 self.inner.unary(req, path, codec).await
1372 }
1373 }
1374}
1375pub mod broadcast_room_server {
1377 #![allow(
1378 unused_variables,
1379 dead_code,
1380 missing_docs,
1381 clippy::wildcard_imports,
1382 clippy::let_unit_value,
1383 )]
1384 use tonic::codegen::*;
1385 #[async_trait]
1387 pub trait BroadcastRoom: std::marker::Send + std::marker::Sync + 'static {
1388 async fn enter(
1390 &self,
1391 request: tonic::Request<super::RoomReq>,
1392 ) -> std::result::Result<tonic::Response<super::RoomResp>, tonic::Status>;
1393 }
1394 #[derive(Debug)]
1396 pub struct BroadcastRoomServer<T> {
1397 inner: Arc<T>,
1398 accept_compression_encodings: EnabledCompressionEncodings,
1399 send_compression_encodings: EnabledCompressionEncodings,
1400 max_decoding_message_size: Option<usize>,
1401 max_encoding_message_size: Option<usize>,
1402 }
1403 impl<T> BroadcastRoomServer<T> {
1404 pub fn new(inner: T) -> Self {
1405 Self::from_arc(Arc::new(inner))
1406 }
1407 pub fn from_arc(inner: Arc<T>) -> Self {
1408 Self {
1409 inner,
1410 accept_compression_encodings: Default::default(),
1411 send_compression_encodings: Default::default(),
1412 max_decoding_message_size: None,
1413 max_encoding_message_size: None,
1414 }
1415 }
1416 pub fn with_interceptor<F>(
1417 inner: T,
1418 interceptor: F,
1419 ) -> InterceptedService<Self, F>
1420 where
1421 F: tonic::service::Interceptor,
1422 {
1423 InterceptedService::new(Self::new(inner), interceptor)
1424 }
1425 #[must_use]
1427 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
1428 self.accept_compression_encodings.enable(encoding);
1429 self
1430 }
1431 #[must_use]
1433 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
1434 self.send_compression_encodings.enable(encoding);
1435 self
1436 }
1437 #[must_use]
1441 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
1442 self.max_decoding_message_size = Some(limit);
1443 self
1444 }
1445 #[must_use]
1449 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
1450 self.max_encoding_message_size = Some(limit);
1451 self
1452 }
1453 }
1454 impl<T, B> tonic::codegen::Service<http::Request<B>> for BroadcastRoomServer<T>
1455 where
1456 T: BroadcastRoom,
1457 B: Body + std::marker::Send + 'static,
1458 B::Error: Into<StdError> + std::marker::Send + 'static,
1459 {
1460 type Response = http::Response<tonic::body::BoxBody>;
1461 type Error = std::convert::Infallible;
1462 type Future = BoxFuture<Self::Response, Self::Error>;
1463 fn poll_ready(
1464 &mut self,
1465 _cx: &mut Context<'_>,
1466 ) -> Poll<std::result::Result<(), Self::Error>> {
1467 Poll::Ready(Ok(()))
1468 }
1469 fn call(&mut self, req: http::Request<B>) -> Self::Future {
1470 match req.uri().path() {
1471 "/bilibili.broadcast.v1.BroadcastRoom/Enter" => {
1472 #[allow(non_camel_case_types)]
1473 struct EnterSvc<T: BroadcastRoom>(pub Arc<T>);
1474 impl<T: BroadcastRoom> tonic::server::UnaryService<super::RoomReq>
1475 for EnterSvc<T> {
1476 type Response = super::RoomResp;
1477 type Future = BoxFuture<
1478 tonic::Response<Self::Response>,
1479 tonic::Status,
1480 >;
1481 fn call(
1482 &mut self,
1483 request: tonic::Request<super::RoomReq>,
1484 ) -> Self::Future {
1485 let inner = Arc::clone(&self.0);
1486 let fut = async move {
1487 <T as BroadcastRoom>::enter(&inner, request).await
1488 };
1489 Box::pin(fut)
1490 }
1491 }
1492 let accept_compression_encodings = self.accept_compression_encodings;
1493 let send_compression_encodings = self.send_compression_encodings;
1494 let max_decoding_message_size = self.max_decoding_message_size;
1495 let max_encoding_message_size = self.max_encoding_message_size;
1496 let inner = self.inner.clone();
1497 let fut = async move {
1498 let method = EnterSvc(inner);
1499 let codec = tonic::codec::ProstCodec::default();
1500 let mut grpc = tonic::server::Grpc::new(codec)
1501 .apply_compression_config(
1502 accept_compression_encodings,
1503 send_compression_encodings,
1504 )
1505 .apply_max_message_size_config(
1506 max_decoding_message_size,
1507 max_encoding_message_size,
1508 );
1509 let res = grpc.unary(method, req).await;
1510 Ok(res)
1511 };
1512 Box::pin(fut)
1513 }
1514 _ => {
1515 Box::pin(async move {
1516 let mut response = http::Response::new(empty_body());
1517 let headers = response.headers_mut();
1518 headers
1519 .insert(
1520 tonic::Status::GRPC_STATUS,
1521 (tonic::Code::Unimplemented as i32).into(),
1522 );
1523 headers
1524 .insert(
1525 http::header::CONTENT_TYPE,
1526 tonic::metadata::GRPC_CONTENT_TYPE,
1527 );
1528 Ok(response)
1529 })
1530 }
1531 }
1532 }
1533 }
1534 impl<T> Clone for BroadcastRoomServer<T> {
1535 fn clone(&self) -> Self {
1536 let inner = self.inner.clone();
1537 Self {
1538 inner,
1539 accept_compression_encodings: self.accept_compression_encodings,
1540 send_compression_encodings: self.send_compression_encodings,
1541 max_decoding_message_size: self.max_decoding_message_size,
1542 max_encoding_message_size: self.max_encoding_message_size,
1543 }
1544 }
1545 }
1546 pub const SERVICE_NAME: &str = "bilibili.broadcast.v1.BroadcastRoom";
1548 impl<T> tonic::server::NamedService for BroadcastRoomServer<T> {
1549 const NAME: &'static str = SERVICE_NAME;
1550 }
1551}
1552pub mod laser_server {
1554 #![allow(
1555 unused_variables,
1556 dead_code,
1557 missing_docs,
1558 clippy::wildcard_imports,
1559 clippy::let_unit_value,
1560 )]
1561 use tonic::codegen::*;
1562 #[async_trait]
1564 pub trait Laser: std::marker::Send + std::marker::Sync + 'static {
1565 async fn watch_log_upload_event(
1567 &self,
1568 request: tonic::Request<()>,
1569 ) -> std::result::Result<
1570 tonic::Response<super::LaserLogUploadResp>,
1571 tonic::Status,
1572 >;
1573 }
1574 #[derive(Debug)]
1576 pub struct LaserServer<T> {
1577 inner: Arc<T>,
1578 accept_compression_encodings: EnabledCompressionEncodings,
1579 send_compression_encodings: EnabledCompressionEncodings,
1580 max_decoding_message_size: Option<usize>,
1581 max_encoding_message_size: Option<usize>,
1582 }
1583 impl<T> LaserServer<T> {
1584 pub fn new(inner: T) -> Self {
1585 Self::from_arc(Arc::new(inner))
1586 }
1587 pub fn from_arc(inner: Arc<T>) -> Self {
1588 Self {
1589 inner,
1590 accept_compression_encodings: Default::default(),
1591 send_compression_encodings: Default::default(),
1592 max_decoding_message_size: None,
1593 max_encoding_message_size: None,
1594 }
1595 }
1596 pub fn with_interceptor<F>(
1597 inner: T,
1598 interceptor: F,
1599 ) -> InterceptedService<Self, F>
1600 where
1601 F: tonic::service::Interceptor,
1602 {
1603 InterceptedService::new(Self::new(inner), interceptor)
1604 }
1605 #[must_use]
1607 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
1608 self.accept_compression_encodings.enable(encoding);
1609 self
1610 }
1611 #[must_use]
1613 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
1614 self.send_compression_encodings.enable(encoding);
1615 self
1616 }
1617 #[must_use]
1621 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
1622 self.max_decoding_message_size = Some(limit);
1623 self
1624 }
1625 #[must_use]
1629 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
1630 self.max_encoding_message_size = Some(limit);
1631 self
1632 }
1633 }
1634 impl<T, B> tonic::codegen::Service<http::Request<B>> for LaserServer<T>
1635 where
1636 T: Laser,
1637 B: Body + std::marker::Send + 'static,
1638 B::Error: Into<StdError> + std::marker::Send + 'static,
1639 {
1640 type Response = http::Response<tonic::body::BoxBody>;
1641 type Error = std::convert::Infallible;
1642 type Future = BoxFuture<Self::Response, Self::Error>;
1643 fn poll_ready(
1644 &mut self,
1645 _cx: &mut Context<'_>,
1646 ) -> Poll<std::result::Result<(), Self::Error>> {
1647 Poll::Ready(Ok(()))
1648 }
1649 fn call(&mut self, req: http::Request<B>) -> Self::Future {
1650 match req.uri().path() {
1651 "/bilibili.broadcast.v1.Laser/WatchLogUploadEvent" => {
1652 #[allow(non_camel_case_types)]
1653 struct WatchLogUploadEventSvc<T: Laser>(pub Arc<T>);
1654 impl<T: Laser> tonic::server::UnaryService<()>
1655 for WatchLogUploadEventSvc<T> {
1656 type Response = super::LaserLogUploadResp;
1657 type Future = BoxFuture<
1658 tonic::Response<Self::Response>,
1659 tonic::Status,
1660 >;
1661 fn call(&mut self, request: tonic::Request<()>) -> Self::Future {
1662 let inner = Arc::clone(&self.0);
1663 let fut = async move {
1664 <T as Laser>::watch_log_upload_event(&inner, request).await
1665 };
1666 Box::pin(fut)
1667 }
1668 }
1669 let accept_compression_encodings = self.accept_compression_encodings;
1670 let send_compression_encodings = self.send_compression_encodings;
1671 let max_decoding_message_size = self.max_decoding_message_size;
1672 let max_encoding_message_size = self.max_encoding_message_size;
1673 let inner = self.inner.clone();
1674 let fut = async move {
1675 let method = WatchLogUploadEventSvc(inner);
1676 let codec = tonic::codec::ProstCodec::default();
1677 let mut grpc = tonic::server::Grpc::new(codec)
1678 .apply_compression_config(
1679 accept_compression_encodings,
1680 send_compression_encodings,
1681 )
1682 .apply_max_message_size_config(
1683 max_decoding_message_size,
1684 max_encoding_message_size,
1685 );
1686 let res = grpc.unary(method, req).await;
1687 Ok(res)
1688 };
1689 Box::pin(fut)
1690 }
1691 _ => {
1692 Box::pin(async move {
1693 let mut response = http::Response::new(empty_body());
1694 let headers = response.headers_mut();
1695 headers
1696 .insert(
1697 tonic::Status::GRPC_STATUS,
1698 (tonic::Code::Unimplemented as i32).into(),
1699 );
1700 headers
1701 .insert(
1702 http::header::CONTENT_TYPE,
1703 tonic::metadata::GRPC_CONTENT_TYPE,
1704 );
1705 Ok(response)
1706 })
1707 }
1708 }
1709 }
1710 }
1711 impl<T> Clone for LaserServer<T> {
1712 fn clone(&self) -> Self {
1713 let inner = self.inner.clone();
1714 Self {
1715 inner,
1716 accept_compression_encodings: self.accept_compression_encodings,
1717 send_compression_encodings: self.send_compression_encodings,
1718 max_decoding_message_size: self.max_decoding_message_size,
1719 max_encoding_message_size: self.max_encoding_message_size,
1720 }
1721 }
1722 }
1723 pub const SERVICE_NAME: &str = "bilibili.broadcast.v1.Laser";
1725 impl<T> tonic::server::NamedService for LaserServer<T> {
1726 const NAME: &'static str = SERVICE_NAME;
1727 }
1728}
1729pub mod mod_manager_server {
1731 #![allow(
1732 unused_variables,
1733 dead_code,
1734 missing_docs,
1735 clippy::wildcard_imports,
1736 clippy::let_unit_value,
1737 )]
1738 use tonic::codegen::*;
1739 #[async_trait]
1741 pub trait ModManager: std::marker::Send + std::marker::Sync + 'static {
1742 async fn watch_resource(
1744 &self,
1745 request: tonic::Request<()>,
1746 ) -> std::result::Result<tonic::Response<super::ModResourceResp>, tonic::Status>;
1747 }
1748 #[derive(Debug)]
1750 pub struct ModManagerServer<T> {
1751 inner: Arc<T>,
1752 accept_compression_encodings: EnabledCompressionEncodings,
1753 send_compression_encodings: EnabledCompressionEncodings,
1754 max_decoding_message_size: Option<usize>,
1755 max_encoding_message_size: Option<usize>,
1756 }
1757 impl<T> ModManagerServer<T> {
1758 pub fn new(inner: T) -> Self {
1759 Self::from_arc(Arc::new(inner))
1760 }
1761 pub fn from_arc(inner: Arc<T>) -> Self {
1762 Self {
1763 inner,
1764 accept_compression_encodings: Default::default(),
1765 send_compression_encodings: Default::default(),
1766 max_decoding_message_size: None,
1767 max_encoding_message_size: None,
1768 }
1769 }
1770 pub fn with_interceptor<F>(
1771 inner: T,
1772 interceptor: F,
1773 ) -> InterceptedService<Self, F>
1774 where
1775 F: tonic::service::Interceptor,
1776 {
1777 InterceptedService::new(Self::new(inner), interceptor)
1778 }
1779 #[must_use]
1781 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
1782 self.accept_compression_encodings.enable(encoding);
1783 self
1784 }
1785 #[must_use]
1787 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
1788 self.send_compression_encodings.enable(encoding);
1789 self
1790 }
1791 #[must_use]
1795 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
1796 self.max_decoding_message_size = Some(limit);
1797 self
1798 }
1799 #[must_use]
1803 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
1804 self.max_encoding_message_size = Some(limit);
1805 self
1806 }
1807 }
1808 impl<T, B> tonic::codegen::Service<http::Request<B>> for ModManagerServer<T>
1809 where
1810 T: ModManager,
1811 B: Body + std::marker::Send + 'static,
1812 B::Error: Into<StdError> + std::marker::Send + 'static,
1813 {
1814 type Response = http::Response<tonic::body::BoxBody>;
1815 type Error = std::convert::Infallible;
1816 type Future = BoxFuture<Self::Response, Self::Error>;
1817 fn poll_ready(
1818 &mut self,
1819 _cx: &mut Context<'_>,
1820 ) -> Poll<std::result::Result<(), Self::Error>> {
1821 Poll::Ready(Ok(()))
1822 }
1823 fn call(&mut self, req: http::Request<B>) -> Self::Future {
1824 match req.uri().path() {
1825 "/bilibili.broadcast.v1.ModManager/WatchResource" => {
1826 #[allow(non_camel_case_types)]
1827 struct WatchResourceSvc<T: ModManager>(pub Arc<T>);
1828 impl<T: ModManager> tonic::server::UnaryService<()>
1829 for WatchResourceSvc<T> {
1830 type Response = super::ModResourceResp;
1831 type Future = BoxFuture<
1832 tonic::Response<Self::Response>,
1833 tonic::Status,
1834 >;
1835 fn call(&mut self, request: tonic::Request<()>) -> Self::Future {
1836 let inner = Arc::clone(&self.0);
1837 let fut = async move {
1838 <T as ModManager>::watch_resource(&inner, request).await
1839 };
1840 Box::pin(fut)
1841 }
1842 }
1843 let accept_compression_encodings = self.accept_compression_encodings;
1844 let send_compression_encodings = self.send_compression_encodings;
1845 let max_decoding_message_size = self.max_decoding_message_size;
1846 let max_encoding_message_size = self.max_encoding_message_size;
1847 let inner = self.inner.clone();
1848 let fut = async move {
1849 let method = WatchResourceSvc(inner);
1850 let codec = tonic::codec::ProstCodec::default();
1851 let mut grpc = tonic::server::Grpc::new(codec)
1852 .apply_compression_config(
1853 accept_compression_encodings,
1854 send_compression_encodings,
1855 )
1856 .apply_max_message_size_config(
1857 max_decoding_message_size,
1858 max_encoding_message_size,
1859 );
1860 let res = grpc.unary(method, req).await;
1861 Ok(res)
1862 };
1863 Box::pin(fut)
1864 }
1865 _ => {
1866 Box::pin(async move {
1867 let mut response = http::Response::new(empty_body());
1868 let headers = response.headers_mut();
1869 headers
1870 .insert(
1871 tonic::Status::GRPC_STATUS,
1872 (tonic::Code::Unimplemented as i32).into(),
1873 );
1874 headers
1875 .insert(
1876 http::header::CONTENT_TYPE,
1877 tonic::metadata::GRPC_CONTENT_TYPE,
1878 );
1879 Ok(response)
1880 })
1881 }
1882 }
1883 }
1884 }
1885 impl<T> Clone for ModManagerServer<T> {
1886 fn clone(&self) -> Self {
1887 let inner = self.inner.clone();
1888 Self {
1889 inner,
1890 accept_compression_encodings: self.accept_compression_encodings,
1891 send_compression_encodings: self.send_compression_encodings,
1892 max_decoding_message_size: self.max_decoding_message_size,
1893 max_encoding_message_size: self.max_encoding_message_size,
1894 }
1895 }
1896 }
1897 pub const SERVICE_NAME: &str = "bilibili.broadcast.v1.ModManager";
1899 impl<T> tonic::server::NamedService for ModManagerServer<T> {
1900 const NAME: &'static str = SERVICE_NAME;
1901 }
1902}
1903pub mod push_server {
1905 #![allow(
1906 unused_variables,
1907 dead_code,
1908 missing_docs,
1909 clippy::wildcard_imports,
1910 clippy::let_unit_value,
1911 )]
1912 use tonic::codegen::*;
1913 #[async_trait]
1915 pub trait Push: std::marker::Send + std::marker::Sync + 'static {
1916 async fn watch_message(
1918 &self,
1919 request: tonic::Request<()>,
1920 ) -> std::result::Result<tonic::Response<super::PushMessageResp>, tonic::Status>;
1921 }
1922 #[derive(Debug)]
1924 pub struct PushServer<T> {
1925 inner: Arc<T>,
1926 accept_compression_encodings: EnabledCompressionEncodings,
1927 send_compression_encodings: EnabledCompressionEncodings,
1928 max_decoding_message_size: Option<usize>,
1929 max_encoding_message_size: Option<usize>,
1930 }
1931 impl<T> PushServer<T> {
1932 pub fn new(inner: T) -> Self {
1933 Self::from_arc(Arc::new(inner))
1934 }
1935 pub fn from_arc(inner: Arc<T>) -> Self {
1936 Self {
1937 inner,
1938 accept_compression_encodings: Default::default(),
1939 send_compression_encodings: Default::default(),
1940 max_decoding_message_size: None,
1941 max_encoding_message_size: None,
1942 }
1943 }
1944 pub fn with_interceptor<F>(
1945 inner: T,
1946 interceptor: F,
1947 ) -> InterceptedService<Self, F>
1948 where
1949 F: tonic::service::Interceptor,
1950 {
1951 InterceptedService::new(Self::new(inner), interceptor)
1952 }
1953 #[must_use]
1955 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
1956 self.accept_compression_encodings.enable(encoding);
1957 self
1958 }
1959 #[must_use]
1961 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
1962 self.send_compression_encodings.enable(encoding);
1963 self
1964 }
1965 #[must_use]
1969 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
1970 self.max_decoding_message_size = Some(limit);
1971 self
1972 }
1973 #[must_use]
1977 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
1978 self.max_encoding_message_size = Some(limit);
1979 self
1980 }
1981 }
1982 impl<T, B> tonic::codegen::Service<http::Request<B>> for PushServer<T>
1983 where
1984 T: Push,
1985 B: Body + std::marker::Send + 'static,
1986 B::Error: Into<StdError> + std::marker::Send + 'static,
1987 {
1988 type Response = http::Response<tonic::body::BoxBody>;
1989 type Error = std::convert::Infallible;
1990 type Future = BoxFuture<Self::Response, Self::Error>;
1991 fn poll_ready(
1992 &mut self,
1993 _cx: &mut Context<'_>,
1994 ) -> Poll<std::result::Result<(), Self::Error>> {
1995 Poll::Ready(Ok(()))
1996 }
1997 fn call(&mut self, req: http::Request<B>) -> Self::Future {
1998 match req.uri().path() {
1999 "/bilibili.broadcast.v1.Push/WatchMessage" => {
2000 #[allow(non_camel_case_types)]
2001 struct WatchMessageSvc<T: Push>(pub Arc<T>);
2002 impl<T: Push> tonic::server::UnaryService<()>
2003 for WatchMessageSvc<T> {
2004 type Response = super::PushMessageResp;
2005 type Future = BoxFuture<
2006 tonic::Response<Self::Response>,
2007 tonic::Status,
2008 >;
2009 fn call(&mut self, request: tonic::Request<()>) -> Self::Future {
2010 let inner = Arc::clone(&self.0);
2011 let fut = async move {
2012 <T as Push>::watch_message(&inner, request).await
2013 };
2014 Box::pin(fut)
2015 }
2016 }
2017 let accept_compression_encodings = self.accept_compression_encodings;
2018 let send_compression_encodings = self.send_compression_encodings;
2019 let max_decoding_message_size = self.max_decoding_message_size;
2020 let max_encoding_message_size = self.max_encoding_message_size;
2021 let inner = self.inner.clone();
2022 let fut = async move {
2023 let method = WatchMessageSvc(inner);
2024 let codec = tonic::codec::ProstCodec::default();
2025 let mut grpc = tonic::server::Grpc::new(codec)
2026 .apply_compression_config(
2027 accept_compression_encodings,
2028 send_compression_encodings,
2029 )
2030 .apply_max_message_size_config(
2031 max_decoding_message_size,
2032 max_encoding_message_size,
2033 );
2034 let res = grpc.unary(method, req).await;
2035 Ok(res)
2036 };
2037 Box::pin(fut)
2038 }
2039 _ => {
2040 Box::pin(async move {
2041 let mut response = http::Response::new(empty_body());
2042 let headers = response.headers_mut();
2043 headers
2044 .insert(
2045 tonic::Status::GRPC_STATUS,
2046 (tonic::Code::Unimplemented as i32).into(),
2047 );
2048 headers
2049 .insert(
2050 http::header::CONTENT_TYPE,
2051 tonic::metadata::GRPC_CONTENT_TYPE,
2052 );
2053 Ok(response)
2054 })
2055 }
2056 }
2057 }
2058 }
2059 impl<T> Clone for PushServer<T> {
2060 fn clone(&self) -> Self {
2061 let inner = self.inner.clone();
2062 Self {
2063 inner,
2064 accept_compression_encodings: self.accept_compression_encodings,
2065 send_compression_encodings: self.send_compression_encodings,
2066 max_decoding_message_size: self.max_decoding_message_size,
2067 max_encoding_message_size: self.max_encoding_message_size,
2068 }
2069 }
2070 }
2071 pub const SERVICE_NAME: &str = "bilibili.broadcast.v1.Push";
2073 impl<T> tonic::server::NamedService for PushServer<T> {
2074 const NAME: &'static str = SERVICE_NAME;
2075 }
2076}
2077pub mod test2_server {
2079 #![allow(
2080 unused_variables,
2081 dead_code,
2082 missing_docs,
2083 clippy::wildcard_imports,
2084 clippy::let_unit_value,
2085 )]
2086 use tonic::codegen::*;
2087 #[async_trait]
2089 pub trait Test2: std::marker::Send + std::marker::Sync + 'static {
2090 async fn test(
2092 &self,
2093 request: tonic::Request<super::AddParams>,
2094 ) -> std::result::Result<tonic::Response<()>, tonic::Status>;
2095 }
2096 #[derive(Debug)]
2098 pub struct Test2Server<T> {
2099 inner: Arc<T>,
2100 accept_compression_encodings: EnabledCompressionEncodings,
2101 send_compression_encodings: EnabledCompressionEncodings,
2102 max_decoding_message_size: Option<usize>,
2103 max_encoding_message_size: Option<usize>,
2104 }
2105 impl<T> Test2Server<T> {
2106 pub fn new(inner: T) -> Self {
2107 Self::from_arc(Arc::new(inner))
2108 }
2109 pub fn from_arc(inner: Arc<T>) -> Self {
2110 Self {
2111 inner,
2112 accept_compression_encodings: Default::default(),
2113 send_compression_encodings: Default::default(),
2114 max_decoding_message_size: None,
2115 max_encoding_message_size: None,
2116 }
2117 }
2118 pub fn with_interceptor<F>(
2119 inner: T,
2120 interceptor: F,
2121 ) -> InterceptedService<Self, F>
2122 where
2123 F: tonic::service::Interceptor,
2124 {
2125 InterceptedService::new(Self::new(inner), interceptor)
2126 }
2127 #[must_use]
2129 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
2130 self.accept_compression_encodings.enable(encoding);
2131 self
2132 }
2133 #[must_use]
2135 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
2136 self.send_compression_encodings.enable(encoding);
2137 self
2138 }
2139 #[must_use]
2143 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
2144 self.max_decoding_message_size = Some(limit);
2145 self
2146 }
2147 #[must_use]
2151 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
2152 self.max_encoding_message_size = Some(limit);
2153 self
2154 }
2155 }
2156 impl<T, B> tonic::codegen::Service<http::Request<B>> for Test2Server<T>
2157 where
2158 T: Test2,
2159 B: Body + std::marker::Send + 'static,
2160 B::Error: Into<StdError> + std::marker::Send + 'static,
2161 {
2162 type Response = http::Response<tonic::body::BoxBody>;
2163 type Error = std::convert::Infallible;
2164 type Future = BoxFuture<Self::Response, Self::Error>;
2165 fn poll_ready(
2166 &mut self,
2167 _cx: &mut Context<'_>,
2168 ) -> Poll<std::result::Result<(), Self::Error>> {
2169 Poll::Ready(Ok(()))
2170 }
2171 fn call(&mut self, req: http::Request<B>) -> Self::Future {
2172 match req.uri().path() {
2173 "/bilibili.broadcast.v1.Test2/Test" => {
2174 #[allow(non_camel_case_types)]
2175 struct TestSvc<T: Test2>(pub Arc<T>);
2176 impl<T: Test2> tonic::server::UnaryService<super::AddParams>
2177 for TestSvc<T> {
2178 type Response = ();
2179 type Future = BoxFuture<
2180 tonic::Response<Self::Response>,
2181 tonic::Status,
2182 >;
2183 fn call(
2184 &mut self,
2185 request: tonic::Request<super::AddParams>,
2186 ) -> Self::Future {
2187 let inner = Arc::clone(&self.0);
2188 let fut = async move {
2189 <T as Test2>::test(&inner, request).await
2190 };
2191 Box::pin(fut)
2192 }
2193 }
2194 let accept_compression_encodings = self.accept_compression_encodings;
2195 let send_compression_encodings = self.send_compression_encodings;
2196 let max_decoding_message_size = self.max_decoding_message_size;
2197 let max_encoding_message_size = self.max_encoding_message_size;
2198 let inner = self.inner.clone();
2199 let fut = async move {
2200 let method = TestSvc(inner);
2201 let codec = tonic::codec::ProstCodec::default();
2202 let mut grpc = tonic::server::Grpc::new(codec)
2203 .apply_compression_config(
2204 accept_compression_encodings,
2205 send_compression_encodings,
2206 )
2207 .apply_max_message_size_config(
2208 max_decoding_message_size,
2209 max_encoding_message_size,
2210 );
2211 let res = grpc.unary(method, req).await;
2212 Ok(res)
2213 };
2214 Box::pin(fut)
2215 }
2216 _ => {
2217 Box::pin(async move {
2218 let mut response = http::Response::new(empty_body());
2219 let headers = response.headers_mut();
2220 headers
2221 .insert(
2222 tonic::Status::GRPC_STATUS,
2223 (tonic::Code::Unimplemented as i32).into(),
2224 );
2225 headers
2226 .insert(
2227 http::header::CONTENT_TYPE,
2228 tonic::metadata::GRPC_CONTENT_TYPE,
2229 );
2230 Ok(response)
2231 })
2232 }
2233 }
2234 }
2235 }
2236 impl<T> Clone for Test2Server<T> {
2237 fn clone(&self) -> Self {
2238 let inner = self.inner.clone();
2239 Self {
2240 inner,
2241 accept_compression_encodings: self.accept_compression_encodings,
2242 send_compression_encodings: self.send_compression_encodings,
2243 max_decoding_message_size: self.max_decoding_message_size,
2244 max_encoding_message_size: self.max_encoding_message_size,
2245 }
2246 }
2247 }
2248 pub const SERVICE_NAME: &str = "bilibili.broadcast.v1.Test2";
2250 impl<T> tonic::server::NamedService for Test2Server<T> {
2251 const NAME: &'static str = SERVICE_NAME;
2252 }
2253}