#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct AddParams {
#[prost(int32, tag = "1")]
pub a: i32,
#[prost(int32, tag = "2")]
pub b: i32,
}
impl ::prost::Name for AddParams {
const NAME: &'static str = "AddParams";
const PACKAGE: &'static str = "bilibili.broadcast.v1";
fn full_name() -> ::prost::alloc::string::String {
"bilibili.broadcast.v1.AddParams".into()
}
fn type_url() -> ::prost::alloc::string::String {
"/bilibili.broadcast.v1.AddParams".into()
}
}
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct AddResult {
#[prost(int32, tag = "1")]
pub r: i32,
}
impl ::prost::Name for AddResult {
const NAME: &'static str = "AddResult";
const PACKAGE: &'static str = "bilibili.broadcast.v1";
fn full_name() -> ::prost::alloc::string::String {
"bilibili.broadcast.v1.AddResult".into()
}
fn type_url() -> ::prost::alloc::string::String {
"/bilibili.broadcast.v1.AddResult".into()
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct AuthReq {
#[prost(string, tag = "1")]
pub guid: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub conn_id: ::prost::alloc::string::String,
#[prost(int64, tag = "3")]
pub last_msg_id: i64,
}
impl ::prost::Name for AuthReq {
const NAME: &'static str = "AuthReq";
const PACKAGE: &'static str = "bilibili.broadcast.v1";
fn full_name() -> ::prost::alloc::string::String {
"bilibili.broadcast.v1.AuthReq".into()
}
fn type_url() -> ::prost::alloc::string::String {
"/bilibili.broadcast.v1.AuthReq".into()
}
}
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct AuthResp {}
impl ::prost::Name for AuthResp {
const NAME: &'static str = "AuthResp";
const PACKAGE: &'static str = "bilibili.broadcast.v1";
fn full_name() -> ::prost::alloc::string::String {
"bilibili.broadcast.v1.AuthResp".into()
}
fn type_url() -> ::prost::alloc::string::String {
"/bilibili.broadcast.v1.AuthResp".into()
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct BroadcastFrame {
#[prost(message, optional, tag = "1")]
pub options: ::core::option::Option<FrameOption>,
#[prost(string, tag = "2")]
pub target_path: ::prost::alloc::string::String,
#[prost(message, optional, tag = "3")]
pub body: ::core::option::Option<::prost_types::Any>,
}
impl ::prost::Name for BroadcastFrame {
const NAME: &'static str = "BroadcastFrame";
const PACKAGE: &'static str = "bilibili.broadcast.v1";
fn full_name() -> ::prost::alloc::string::String {
"bilibili.broadcast.v1.BroadcastFrame".into()
}
fn type_url() -> ::prost::alloc::string::String {
"/bilibili.broadcast.v1.BroadcastFrame".into()
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct FrameOption {
#[prost(int64, tag = "1")]
pub message_id: i64,
#[prost(int64, tag = "2")]
pub sequence: i64,
#[prost(bool, tag = "3")]
pub is_ack: bool,
#[prost(message, optional, tag = "4")]
pub status: ::core::option::Option<super::super::rpc::Status>,
#[prost(string, tag = "5")]
pub ack_origin: ::prost::alloc::string::String,
#[prost(int64, tag = "6")]
pub timestamp: i64,
#[prost(int64, tag = "7")]
pub msg_type: i64,
}
impl ::prost::Name for FrameOption {
const NAME: &'static str = "FrameOption";
const PACKAGE: &'static str = "bilibili.broadcast.v1";
fn full_name() -> ::prost::alloc::string::String {
"bilibili.broadcast.v1.FrameOption".into()
}
fn type_url() -> ::prost::alloc::string::String {
"/bilibili.broadcast.v1.FrameOption".into()
}
}
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct HeartbeatReq {}
impl ::prost::Name for HeartbeatReq {
const NAME: &'static str = "HeartbeatReq";
const PACKAGE: &'static str = "bilibili.broadcast.v1";
fn full_name() -> ::prost::alloc::string::String {
"bilibili.broadcast.v1.HeartbeatReq".into()
}
fn type_url() -> ::prost::alloc::string::String {
"/bilibili.broadcast.v1.HeartbeatReq".into()
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct HeartbeatResp {
#[prost(enumeration = "heartbeat_resp::OpType", tag = "1")]
pub op_type: i32,
#[prost(string, tag = "2")]
pub target_hostname: ::prost::alloc::string::String,
#[prost(string, tag = "3")]
pub target_ip: ::prost::alloc::string::String,
#[prost(int64, tag = "4")]
pub target_port: i64,
#[prost(int64, tag = "5")]
pub target_ttl: i64,
}
pub mod heartbeat_resp {
#[derive(
Clone,
Copy,
Debug,
PartialEq,
Eq,
Hash,
PartialOrd,
Ord,
::prost::Enumeration
)]
#[repr(i32)]
pub enum OpType {
Default = 0,
Unhealthy = 1,
Migration = 2,
}
impl OpType {
pub fn as_str_name(&self) -> &'static str {
match self {
Self::Default => "DEFAULT",
Self::Unhealthy => "UNHEALTHY",
Self::Migration => "MIGRATION",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"DEFAULT" => Some(Self::Default),
"UNHEALTHY" => Some(Self::Unhealthy),
"MIGRATION" => Some(Self::Migration),
_ => None,
}
}
}
}
impl ::prost::Name for HeartbeatResp {
const NAME: &'static str = "HeartbeatResp";
const PACKAGE: &'static str = "bilibili.broadcast.v1";
fn full_name() -> ::prost::alloc::string::String {
"bilibili.broadcast.v1.HeartbeatResp".into()
}
fn type_url() -> ::prost::alloc::string::String {
"/bilibili.broadcast.v1.HeartbeatResp".into()
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct LaserLogUploadResp {
#[prost(int64, tag = "1")]
pub taskid: i64,
#[prost(string, tag = "2")]
pub date: ::prost::alloc::string::String,
}
impl ::prost::Name for LaserLogUploadResp {
const NAME: &'static str = "LaserLogUploadResp";
const PACKAGE: &'static str = "bilibili.broadcast.v1";
fn full_name() -> ::prost::alloc::string::String {
"bilibili.broadcast.v1.LaserLogUploadResp".into()
}
fn type_url() -> ::prost::alloc::string::String {
"/bilibili.broadcast.v1.LaserLogUploadResp".into()
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct MessageAckReq {
#[prost(int64, tag = "1")]
pub ack_id: i64,
#[prost(string, tag = "2")]
pub ack_origin: ::prost::alloc::string::String,
#[prost(string, tag = "3")]
pub target_path: ::prost::alloc::string::String,
#[prost(int64, tag = "4")]
pub msg_type: i64,
}
impl ::prost::Name for MessageAckReq {
const NAME: &'static str = "MessageAckReq";
const PACKAGE: &'static str = "bilibili.broadcast.v1";
fn full_name() -> ::prost::alloc::string::String {
"bilibili.broadcast.v1.MessageAckReq".into()
}
fn type_url() -> ::prost::alloc::string::String {
"/bilibili.broadcast.v1.MessageAckReq".into()
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ModResourceResp {
#[prost(enumeration = "Action", tag = "1")]
pub atcion: i32,
#[prost(string, tag = "2")]
pub app_key: ::prost::alloc::string::String,
#[prost(string, tag = "3")]
pub pool_name: ::prost::alloc::string::String,
#[prost(string, tag = "4")]
pub module_name: ::prost::alloc::string::String,
#[prost(int64, tag = "5")]
pub module_version: i64,
#[prost(int64, tag = "6")]
pub list_version: i64,
}
impl ::prost::Name for ModResourceResp {
const NAME: &'static str = "ModResourceResp";
const PACKAGE: &'static str = "bilibili.broadcast.v1";
fn full_name() -> ::prost::alloc::string::String {
"bilibili.broadcast.v1.ModResourceResp".into()
}
fn type_url() -> ::prost::alloc::string::String {
"/bilibili.broadcast.v1.ModResourceResp".into()
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct PageBlackList {
#[prost(string, tag = "1")]
pub id: ::prost::alloc::string::String,
}
impl ::prost::Name for PageBlackList {
const NAME: &'static str = "PageBlackList";
const PACKAGE: &'static str = "bilibili.broadcast.v1";
fn full_name() -> ::prost::alloc::string::String {
"bilibili.broadcast.v1.PageBlackList".into()
}
fn type_url() -> ::prost::alloc::string::String {
"/bilibili.broadcast.v1.PageBlackList".into()
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct PageView {
#[prost(string, tag = "1")]
pub id: ::prost::alloc::string::String,
}
impl ::prost::Name for PageView {
const NAME: &'static str = "PageView";
const PACKAGE: &'static str = "bilibili.broadcast.v1";
fn full_name() -> ::prost::alloc::string::String {
"bilibili.broadcast.v1.PageView".into()
}
fn type_url() -> ::prost::alloc::string::String {
"/bilibili.broadcast.v1.PageView".into()
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct PushMessageResp {
#[prost(int64, tag = "1")]
pub old_taskid: i64,
#[prost(enumeration = "push_message_resp::Biz", tag = "2")]
pub biz: i32,
#[prost(enumeration = "push_message_resp::Type", tag = "3")]
pub r#type: i32,
#[prost(string, tag = "4")]
pub title: ::prost::alloc::string::String,
#[prost(string, tag = "5")]
pub summary: ::prost::alloc::string::String,
#[prost(string, tag = "6")]
pub img: ::prost::alloc::string::String,
#[prost(string, tag = "7")]
pub link: ::prost::alloc::string::String,
#[prost(enumeration = "push_message_resp::Position", tag = "8")]
pub position: i32,
#[prost(int32, tag = "9")]
pub duration: i32,
#[prost(int64, tag = "10")]
pub expire: i64,
#[prost(string, tag = "11")]
pub taskid: ::prost::alloc::string::String,
#[prost(message, repeated, tag = "12")]
pub page_black_list: ::prost::alloc::vec::Vec<PageBlackList>,
#[prost(message, repeated, tag = "13")]
pub page_view: ::prost::alloc::vec::Vec<PageView>,
#[prost(message, optional, tag = "14")]
pub target_resource: ::core::option::Option<TargetResource>,
#[prost(enumeration = "push_message_resp::ImageFrame", tag = "15")]
pub image_frame: i32,
#[prost(enumeration = "push_message_resp::ImageMarker", tag = "16")]
pub image_marker: i32,
#[prost(enumeration = "push_message_resp::ImagePosition", tag = "17")]
pub image_position: i32,
#[prost(int64, tag = "18")]
pub job: i64,
#[prost(string, tag = "19")]
pub msg_source: ::prost::alloc::string::String,
#[prost(bool, tag = "20")]
pub hide_arrow: bool,
#[prost(map = "string, string", tag = "21")]
pub metadata: ::std::collections::HashMap<
::prost::alloc::string::String,
::prost::alloc::string::String,
>,
#[prost(string, tag = "22")]
pub pure_img: ::prost::alloc::string::String,
#[prost(enumeration = "push_message_resp::DisplayType", tag = "23")]
pub display_type: i32,
#[prost(enumeration = "push_message_resp::PopType", tag = "24")]
pub pop_type: i32,
#[prost(int32, tag = "25")]
pub reserve: i32,
#[prost(int32, tag = "26")]
pub level: i32,
#[prost(bool, tag = "27")]
pub query: bool,
#[prost(int32, tag = "28")]
pub bid: i32,
#[prost(string, tag = "30")]
pub extra: ::prost::alloc::string::String,
}
pub mod push_message_resp {
#[derive(
Clone,
Copy,
Debug,
PartialEq,
Eq,
Hash,
PartialOrd,
Ord,
::prost::Enumeration
)]
#[repr(i32)]
pub enum Biz {
Unknown = 0,
Video = 1,
Live = 2,
Activity = 3,
}
impl Biz {
pub fn as_str_name(&self) -> &'static str {
match self {
Self::Unknown => "BIZ_UNKNOWN",
Self::Video => "BIZ_VIDEO",
Self::Live => "BIZ_LIVE",
Self::Activity => "BIZ_ACTIVITY",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"BIZ_UNKNOWN" => Some(Self::Unknown),
"BIZ_VIDEO" => Some(Self::Video),
"BIZ_LIVE" => Some(Self::Live),
"BIZ_ACTIVITY" => Some(Self::Activity),
_ => None,
}
}
}
#[derive(
Clone,
Copy,
Debug,
PartialEq,
Eq,
Hash,
PartialOrd,
Ord,
::prost::Enumeration
)]
#[repr(i32)]
pub enum DisplayType {
DisPlayText = 0,
DisplaySatic = 1,
DisplayGif = 2,
}
impl DisplayType {
pub fn as_str_name(&self) -> &'static str {
match self {
Self::DisPlayText => "DisPlayText",
Self::DisplaySatic => "DisplaySatic",
Self::DisplayGif => "DisplayGif",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"DisPlayText" => Some(Self::DisPlayText),
"DisplaySatic" => Some(Self::DisplaySatic),
"DisplayGif" => Some(Self::DisplayGif),
_ => None,
}
}
}
#[derive(
Clone,
Copy,
Debug,
PartialEq,
Eq,
Hash,
PartialOrd,
Ord,
::prost::Enumeration
)]
#[repr(i32)]
pub enum ImageFrame {
FrameUnknown = 0,
FrameLive = 1,
}
impl ImageFrame {
pub fn as_str_name(&self) -> &'static str {
match self {
Self::FrameUnknown => "FRAME_UNKNOWN",
Self::FrameLive => "FRAME_LIVE",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"FRAME_UNKNOWN" => Some(Self::FrameUnknown),
"FRAME_LIVE" => Some(Self::FrameLive),
_ => None,
}
}
}
#[derive(
Clone,
Copy,
Debug,
PartialEq,
Eq,
Hash,
PartialOrd,
Ord,
::prost::Enumeration
)]
#[repr(i32)]
pub enum ImageMarker {
MarkerUnknown = 0,
MarkerLive = 1,
}
impl ImageMarker {
pub fn as_str_name(&self) -> &'static str {
match self {
Self::MarkerUnknown => "MARKER_UNKNOWN",
Self::MarkerLive => "MARKER_LIVE",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"MARKER_UNKNOWN" => Some(Self::MarkerUnknown),
"MARKER_LIVE" => Some(Self::MarkerLive),
_ => None,
}
}
}
#[derive(
Clone,
Copy,
Debug,
PartialEq,
Eq,
Hash,
PartialOrd,
Ord,
::prost::Enumeration
)]
#[repr(i32)]
pub enum ImagePosition {
ImagePosUnknown = 0,
ImagePosLeft = 1,
ImagePosRight = 2,
}
impl ImagePosition {
pub fn as_str_name(&self) -> &'static str {
match self {
Self::ImagePosUnknown => "IMAGE_POS_UNKNOWN",
Self::ImagePosLeft => "IMAGE_POS_LEFT",
Self::ImagePosRight => "IMAGE_POS_RIGHT",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"IMAGE_POS_UNKNOWN" => Some(Self::ImagePosUnknown),
"IMAGE_POS_LEFT" => Some(Self::ImagePosLeft),
"IMAGE_POS_RIGHT" => Some(Self::ImagePosRight),
_ => None,
}
}
}
#[derive(
Clone,
Copy,
Debug,
PartialEq,
Eq,
Hash,
PartialOrd,
Ord,
::prost::Enumeration
)]
#[repr(i32)]
pub enum PopType {
TopToBottom = 0,
RightToLeft = 1,
}
impl PopType {
pub fn as_str_name(&self) -> &'static str {
match self {
Self::TopToBottom => "TopToBottom",
Self::RightToLeft => "RightToLeft",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"TopToBottom" => Some(Self::TopToBottom),
"RightToLeft" => Some(Self::RightToLeft),
_ => None,
}
}
}
#[derive(
Clone,
Copy,
Debug,
PartialEq,
Eq,
Hash,
PartialOrd,
Ord,
::prost::Enumeration
)]
#[repr(i32)]
pub enum Position {
PosUnknown = 0,
PosTop = 1,
}
impl Position {
pub fn as_str_name(&self) -> &'static str {
match self {
Self::PosUnknown => "POS_UNKNOWN",
Self::PosTop => "POS_TOP",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"POS_UNKNOWN" => Some(Self::PosUnknown),
"POS_TOP" => Some(Self::PosTop),
_ => None,
}
}
}
#[derive(
Clone,
Copy,
Debug,
PartialEq,
Eq,
Hash,
PartialOrd,
Ord,
::prost::Enumeration
)]
#[repr(i32)]
pub enum Type {
Unknown = 0,
Default = 1,
Hot = 2,
Realtime = 3,
Recommend = 4,
Reply = 5,
}
impl Type {
pub fn as_str_name(&self) -> &'static str {
match self {
Self::Unknown => "TYPE_UNKNOWN",
Self::Default => "TYPE_DEFAULT",
Self::Hot => "TYPE_HOT",
Self::Realtime => "TYPE_REALTIME",
Self::Recommend => "TYPE_RECOMMEND",
Self::Reply => "TYPE_REPLY",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"TYPE_UNKNOWN" => Some(Self::Unknown),
"TYPE_DEFAULT" => Some(Self::Default),
"TYPE_HOT" => Some(Self::Hot),
"TYPE_REALTIME" => Some(Self::Realtime),
"TYPE_RECOMMEND" => Some(Self::Recommend),
"TYPE_REPLY" => Some(Self::Reply),
_ => None,
}
}
}
}
impl ::prost::Name for PushMessageResp {
const NAME: &'static str = "PushMessageResp";
const PACKAGE: &'static str = "bilibili.broadcast.v1";
fn full_name() -> ::prost::alloc::string::String {
"bilibili.broadcast.v1.PushMessageResp".into()
}
fn type_url() -> ::prost::alloc::string::String {
"/bilibili.broadcast.v1.PushMessageResp".into()
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct RoomErrorEvent {
#[prost(message, optional, tag = "1")]
pub status: ::core::option::Option<super::super::rpc::Status>,
}
impl ::prost::Name for RoomErrorEvent {
const NAME: &'static str = "RoomErrorEvent";
const PACKAGE: &'static str = "bilibili.broadcast.v1";
fn full_name() -> ::prost::alloc::string::String {
"bilibili.broadcast.v1.RoomErrorEvent".into()
}
fn type_url() -> ::prost::alloc::string::String {
"/bilibili.broadcast.v1.RoomErrorEvent".into()
}
}
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct RoomJoinEvent {}
impl ::prost::Name for RoomJoinEvent {
const NAME: &'static str = "RoomJoinEvent";
const PACKAGE: &'static str = "bilibili.broadcast.v1";
fn full_name() -> ::prost::alloc::string::String {
"bilibili.broadcast.v1.RoomJoinEvent".into()
}
fn type_url() -> ::prost::alloc::string::String {
"/bilibili.broadcast.v1.RoomJoinEvent".into()
}
}
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct RoomLeaveEvent {}
impl ::prost::Name for RoomLeaveEvent {
const NAME: &'static str = "RoomLeaveEvent";
const PACKAGE: &'static str = "bilibili.broadcast.v1";
fn full_name() -> ::prost::alloc::string::String {
"bilibili.broadcast.v1.RoomLeaveEvent".into()
}
fn type_url() -> ::prost::alloc::string::String {
"/bilibili.broadcast.v1.RoomLeaveEvent".into()
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct RoomMessageEvent {
#[prost(string, tag = "1")]
pub target_path: ::prost::alloc::string::String,
#[prost(message, optional, tag = "2")]
pub body: ::core::option::Option<::prost_types::Any>,
}
impl ::prost::Name for RoomMessageEvent {
const NAME: &'static str = "RoomMessageEvent";
const PACKAGE: &'static str = "bilibili.broadcast.v1";
fn full_name() -> ::prost::alloc::string::String {
"bilibili.broadcast.v1.RoomMessageEvent".into()
}
fn type_url() -> ::prost::alloc::string::String {
"/bilibili.broadcast.v1.RoomMessageEvent".into()
}
}
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct RoomOnlineEvent {
#[prost(int32, tag = "1")]
pub online: i32,
#[prost(int32, tag = "2")]
pub all_online: i32,
}
impl ::prost::Name for RoomOnlineEvent {
const NAME: &'static str = "RoomOnlineEvent";
const PACKAGE: &'static str = "bilibili.broadcast.v1";
fn full_name() -> ::prost::alloc::string::String {
"bilibili.broadcast.v1.RoomOnlineEvent".into()
}
fn type_url() -> ::prost::alloc::string::String {
"/bilibili.broadcast.v1.RoomOnlineEvent".into()
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct RoomReq {
#[prost(string, tag = "1")]
pub id: ::prost::alloc::string::String,
#[prost(oneof = "room_req::Event", tags = "2, 3, 4, 5")]
pub event: ::core::option::Option<room_req::Event>,
}
pub mod room_req {
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum Event {
#[prost(message, tag = "2")]
Join(super::RoomJoinEvent),
#[prost(message, tag = "3")]
Leave(super::RoomLeaveEvent),
#[prost(message, tag = "4")]
Online(super::RoomOnlineEvent),
#[prost(message, tag = "5")]
Msg(super::RoomMessageEvent),
}
}
impl ::prost::Name for RoomReq {
const NAME: &'static str = "RoomReq";
const PACKAGE: &'static str = "bilibili.broadcast.v1";
fn full_name() -> ::prost::alloc::string::String {
"bilibili.broadcast.v1.RoomReq".into()
}
fn type_url() -> ::prost::alloc::string::String {
"/bilibili.broadcast.v1.RoomReq".into()
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct RoomResp {
#[prost(string, tag = "1")]
pub id: ::prost::alloc::string::String,
#[prost(oneof = "room_resp::Event", tags = "2, 3, 4, 5, 6")]
pub event: ::core::option::Option<room_resp::Event>,
}
pub mod room_resp {
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum Event {
#[prost(message, tag = "2")]
Join(super::RoomJoinEvent),
#[prost(message, tag = "3")]
Leave(super::RoomLeaveEvent),
#[prost(message, tag = "4")]
Online(super::RoomOnlineEvent),
#[prost(message, tag = "5")]
Msg(super::RoomMessageEvent),
#[prost(message, tag = "6")]
Err(super::RoomErrorEvent),
}
}
impl ::prost::Name for RoomResp {
const NAME: &'static str = "RoomResp";
const PACKAGE: &'static str = "bilibili.broadcast.v1";
fn full_name() -> ::prost::alloc::string::String {
"bilibili.broadcast.v1.RoomResp".into()
}
fn type_url() -> ::prost::alloc::string::String {
"/bilibili.broadcast.v1.RoomResp".into()
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct TargetPath {
#[prost(string, repeated, tag = "1")]
pub target_paths: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
}
impl ::prost::Name for TargetPath {
const NAME: &'static str = "TargetPath";
const PACKAGE: &'static str = "bilibili.broadcast.v1";
fn full_name() -> ::prost::alloc::string::String {
"bilibili.broadcast.v1.TargetPath".into()
}
fn type_url() -> ::prost::alloc::string::String {
"/bilibili.broadcast.v1.TargetPath".into()
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct TargetResource {
#[prost(enumeration = "LinkType", tag = "1")]
pub r#type: i32,
#[prost(map = "string, string", tag = "2")]
pub resource: ::std::collections::HashMap<
::prost::alloc::string::String,
::prost::alloc::string::String,
>,
}
impl ::prost::Name for TargetResource {
const NAME: &'static str = "TargetResource";
const PACKAGE: &'static str = "bilibili.broadcast.v1";
fn full_name() -> ::prost::alloc::string::String {
"bilibili.broadcast.v1.TargetResource".into()
}
fn type_url() -> ::prost::alloc::string::String {
"/bilibili.broadcast.v1.TargetResource".into()
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct TestResp {
#[prost(int64, tag = "1")]
pub taskid: i64,
#[prost(int64, tag = "2")]
pub timestamp: i64,
#[prost(string, tag = "3")]
pub message: ::prost::alloc::string::String,
#[prost(message, optional, tag = "4")]
pub extra: ::core::option::Option<::prost_types::Any>,
}
impl ::prost::Name for TestResp {
const NAME: &'static str = "TestResp";
const PACKAGE: &'static str = "bilibili.broadcast.v1";
fn full_name() -> ::prost::alloc::string::String {
"bilibili.broadcast.v1.TestResp".into()
}
fn type_url() -> ::prost::alloc::string::String {
"/bilibili.broadcast.v1.TestResp".into()
}
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum Action {
Unknown = 0,
Update = 1,
Delete = 2,
}
impl Action {
pub fn as_str_name(&self) -> &'static str {
match self {
Self::Unknown => "UNKNOWN",
Self::Update => "UPDATE",
Self::Delete => "DELETE",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"UNKNOWN" => Some(Self::Unknown),
"UPDATE" => Some(Self::Update),
"DELETE" => Some(Self::Delete),
_ => None,
}
}
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum LinkType {
Unknown = 0,
Bangumi = 1,
Video = 2,
Live = 3,
}
impl LinkType {
pub fn as_str_name(&self) -> &'static str {
match self {
Self::Unknown => "LINK_TYPE_UNKNOWN",
Self::Bangumi => "LINK_TYPE_BANGUMI",
Self::Video => "LINK_TYPE_VIDEO",
Self::Live => "LINK_TYPE_LIVE",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"LINK_TYPE_UNKNOWN" => Some(Self::Unknown),
"LINK_TYPE_BANGUMI" => Some(Self::Bangumi),
"LINK_TYPE_VIDEO" => Some(Self::Video),
"LINK_TYPE_LIVE" => Some(Self::Live),
_ => None,
}
}
}
#[cfg(feature = "feat-enable-generated-client")]
pub mod broadcast_room_client {
#![allow(
unused_variables,
dead_code,
missing_docs,
clippy::wildcard_imports,
clippy::let_unit_value,
)]
use tonic::codegen::*;
use tonic::codegen::http::Uri;
#[derive(Debug, Clone)]
pub struct BroadcastRoomClient<T> {
inner: tonic::client::Grpc<T>,
}
impl<T> BroadcastRoomClient<T>
where
T: tonic::client::GrpcService<tonic::body::Body>,
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,
) -> BroadcastRoomClient<InterceptedService<T, F>>
where
F: tonic::service::Interceptor,
T::ResponseBody: Default,
T: tonic::codegen::Service<
http::Request<tonic::body::Body>,
Response = http::Response<
<T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
>,
>,
<T as tonic::codegen::Service<
http::Request<tonic::body::Body>,
>>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
{
BroadcastRoomClient::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 enter(
&mut self,
request: impl tonic::IntoStreamingRequest<Message = super::RoomReq>,
) -> std::result::Result<
tonic::Response<tonic::codec::Streaming<super::RoomResp>>,
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(
"/bilibili.broadcast.v1.BroadcastRoom/Enter",
);
let mut req = request.into_streaming_request();
req.extensions_mut()
.insert(GrpcMethod::new("bilibili.broadcast.v1.BroadcastRoom", "Enter"));
self.inner.streaming(req, path, codec).await
}
}
}
#[cfg(feature = "feat-enable-generated-client")]
pub mod laser_client {
#![allow(
unused_variables,
dead_code,
missing_docs,
clippy::wildcard_imports,
clippy::let_unit_value,
)]
use tonic::codegen::*;
use tonic::codegen::http::Uri;
#[derive(Debug, Clone)]
pub struct LaserClient<T> {
inner: tonic::client::Grpc<T>,
}
impl<T> LaserClient<T>
where
T: tonic::client::GrpcService<tonic::body::Body>,
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,
) -> LaserClient<InterceptedService<T, F>>
where
F: tonic::service::Interceptor,
T::ResponseBody: Default,
T: tonic::codegen::Service<
http::Request<tonic::body::Body>,
Response = http::Response<
<T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
>,
>,
<T as tonic::codegen::Service<
http::Request<tonic::body::Body>,
>>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
{
LaserClient::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 watch_log_upload_event(
&mut self,
request: impl tonic::IntoRequest<()>,
) -> std::result::Result<
tonic::Response<tonic::codec::Streaming<super::LaserLogUploadResp>>,
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(
"/bilibili.broadcast.v1.Laser/WatchLogUploadEvent",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new("bilibili.broadcast.v1.Laser", "WatchLogUploadEvent"),
);
self.inner.server_streaming(req, path, codec).await
}
}
}
#[cfg(feature = "feat-enable-generated-client")]
pub mod mod_manager_client {
#![allow(
unused_variables,
dead_code,
missing_docs,
clippy::wildcard_imports,
clippy::let_unit_value,
)]
use tonic::codegen::*;
use tonic::codegen::http::Uri;
#[derive(Debug, Clone)]
pub struct ModManagerClient<T> {
inner: tonic::client::Grpc<T>,
}
impl<T> ModManagerClient<T>
where
T: tonic::client::GrpcService<tonic::body::Body>,
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,
) -> ModManagerClient<InterceptedService<T, F>>
where
F: tonic::service::Interceptor,
T::ResponseBody: Default,
T: tonic::codegen::Service<
http::Request<tonic::body::Body>,
Response = http::Response<
<T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
>,
>,
<T as tonic::codegen::Service<
http::Request<tonic::body::Body>,
>>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
{
ModManagerClient::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 watch_resource(
&mut self,
request: impl tonic::IntoRequest<()>,
) -> std::result::Result<
tonic::Response<tonic::codec::Streaming<super::ModResourceResp>>,
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(
"/bilibili.broadcast.v1.ModManager/WatchResource",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new("bilibili.broadcast.v1.ModManager", "WatchResource"),
);
self.inner.server_streaming(req, path, codec).await
}
}
}
#[cfg(feature = "feat-enable-generated-client")]
pub mod push_client {
#![allow(
unused_variables,
dead_code,
missing_docs,
clippy::wildcard_imports,
clippy::let_unit_value,
)]
use tonic::codegen::*;
use tonic::codegen::http::Uri;
#[derive(Debug, Clone)]
pub struct PushClient<T> {
inner: tonic::client::Grpc<T>,
}
impl<T> PushClient<T>
where
T: tonic::client::GrpcService<tonic::body::Body>,
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,
) -> PushClient<InterceptedService<T, F>>
where
F: tonic::service::Interceptor,
T::ResponseBody: Default,
T: tonic::codegen::Service<
http::Request<tonic::body::Body>,
Response = http::Response<
<T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
>,
>,
<T as tonic::codegen::Service<
http::Request<tonic::body::Body>,
>>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
{
PushClient::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 watch_message(
&mut self,
request: impl tonic::IntoRequest<()>,
) -> std::result::Result<
tonic::Response<tonic::codec::Streaming<super::PushMessageResp>>,
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(
"/bilibili.broadcast.v1.Push/WatchMessage",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("bilibili.broadcast.v1.Push", "WatchMessage"));
self.inner.server_streaming(req, path, codec).await
}
}
}
#[cfg(feature = "feat-enable-generated-client")]
pub mod test2_client {
#![allow(
unused_variables,
dead_code,
missing_docs,
clippy::wildcard_imports,
clippy::let_unit_value,
)]
use tonic::codegen::*;
use tonic::codegen::http::Uri;
#[derive(Debug, Clone)]
pub struct Test2Client<T> {
inner: tonic::client::Grpc<T>,
}
impl<T> Test2Client<T>
where
T: tonic::client::GrpcService<tonic::body::Body>,
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,
) -> Test2Client<InterceptedService<T, F>>
where
F: tonic::service::Interceptor,
T::ResponseBody: Default,
T: tonic::codegen::Service<
http::Request<tonic::body::Body>,
Response = http::Response<
<T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
>,
>,
<T as tonic::codegen::Service<
http::Request<tonic::body::Body>,
>>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
{
Test2Client::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 test(
&mut self,
request: impl tonic::IntoStreamingRequest<Message = super::AddParams>,
) -> 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(
"/bilibili.broadcast.v1.Test2/Test",
);
let mut req = request.into_streaming_request();
req.extensions_mut()
.insert(GrpcMethod::new("bilibili.broadcast.v1.Test2", "Test"));
self.inner.client_streaming(req, path, codec).await
}
}
}
#[cfg(feature = "feat-enable-generated-server")]
pub mod broadcast_room_server {
#![allow(
unused_variables,
dead_code,
missing_docs,
clippy::wildcard_imports,
clippy::let_unit_value,
)]
use tonic::codegen::*;
#[async_trait]
pub trait BroadcastRoom: std::marker::Send + std::marker::Sync + 'static {
type EnterStream: tonic::codegen::tokio_stream::Stream<
Item = std::result::Result<super::RoomResp, tonic::Status>,
>
+ std::marker::Send
+ 'static;
async fn enter(
&self,
request: tonic::Request<tonic::Streaming<super::RoomReq>>,
) -> std::result::Result<tonic::Response<Self::EnterStream>, tonic::Status>;
}
#[derive(Debug)]
pub struct BroadcastRoomServer<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> BroadcastRoomServer<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 BroadcastRoomServer<T>
where
T: BroadcastRoom,
B: Body + std::marker::Send + 'static,
B::Error: Into<StdError> + std::marker::Send + 'static,
{
type Response = http::Response<tonic::body::Body>;
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() {
"/bilibili.broadcast.v1.BroadcastRoom/Enter" => {
#[allow(non_camel_case_types)]
struct EnterSvc<T: BroadcastRoom>(pub Arc<T>);
impl<
T: BroadcastRoom,
> tonic::server::StreamingService<super::RoomReq> for EnterSvc<T> {
type Response = super::RoomResp;
type ResponseStream = T::EnterStream;
type Future = BoxFuture<
tonic::Response<Self::ResponseStream>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<tonic::Streaming<super::RoomReq>>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as BroadcastRoom>::enter(&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 = EnterSvc(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)
}
_ => {
Box::pin(async move {
let mut response = http::Response::new(
tonic::body::Body::default(),
);
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 BroadcastRoomServer<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 = "bilibili.broadcast.v1.BroadcastRoom";
impl<T> tonic::server::NamedService for BroadcastRoomServer<T> {
const NAME: &'static str = SERVICE_NAME;
}
}
#[cfg(feature = "feat-enable-generated-server")]
pub mod laser_server {
#![allow(
unused_variables,
dead_code,
missing_docs,
clippy::wildcard_imports,
clippy::let_unit_value,
)]
use tonic::codegen::*;
#[async_trait]
pub trait Laser: std::marker::Send + std::marker::Sync + 'static {
type WatchLogUploadEventStream: tonic::codegen::tokio_stream::Stream<
Item = std::result::Result<super::LaserLogUploadResp, tonic::Status>,
>
+ std::marker::Send
+ 'static;
async fn watch_log_upload_event(
&self,
request: tonic::Request<()>,
) -> std::result::Result<
tonic::Response<Self::WatchLogUploadEventStream>,
tonic::Status,
>;
}
#[derive(Debug)]
pub struct LaserServer<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> LaserServer<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 LaserServer<T>
where
T: Laser,
B: Body + std::marker::Send + 'static,
B::Error: Into<StdError> + std::marker::Send + 'static,
{
type Response = http::Response<tonic::body::Body>;
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() {
"/bilibili.broadcast.v1.Laser/WatchLogUploadEvent" => {
#[allow(non_camel_case_types)]
struct WatchLogUploadEventSvc<T: Laser>(pub Arc<T>);
impl<T: Laser> tonic::server::ServerStreamingService<()>
for WatchLogUploadEventSvc<T> {
type Response = super::LaserLogUploadResp;
type ResponseStream = T::WatchLogUploadEventStream;
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 Laser>::watch_log_upload_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 = WatchLogUploadEventSvc(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(
tonic::body::Body::default(),
);
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 LaserServer<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 = "bilibili.broadcast.v1.Laser";
impl<T> tonic::server::NamedService for LaserServer<T> {
const NAME: &'static str = SERVICE_NAME;
}
}
#[cfg(feature = "feat-enable-generated-server")]
pub mod mod_manager_server {
#![allow(
unused_variables,
dead_code,
missing_docs,
clippy::wildcard_imports,
clippy::let_unit_value,
)]
use tonic::codegen::*;
#[async_trait]
pub trait ModManager: std::marker::Send + std::marker::Sync + 'static {
type WatchResourceStream: tonic::codegen::tokio_stream::Stream<
Item = std::result::Result<super::ModResourceResp, tonic::Status>,
>
+ std::marker::Send
+ 'static;
async fn watch_resource(
&self,
request: tonic::Request<()>,
) -> std::result::Result<
tonic::Response<Self::WatchResourceStream>,
tonic::Status,
>;
}
#[derive(Debug)]
pub struct ModManagerServer<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> ModManagerServer<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 ModManagerServer<T>
where
T: ModManager,
B: Body + std::marker::Send + 'static,
B::Error: Into<StdError> + std::marker::Send + 'static,
{
type Response = http::Response<tonic::body::Body>;
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() {
"/bilibili.broadcast.v1.ModManager/WatchResource" => {
#[allow(non_camel_case_types)]
struct WatchResourceSvc<T: ModManager>(pub Arc<T>);
impl<T: ModManager> tonic::server::ServerStreamingService<()>
for WatchResourceSvc<T> {
type Response = super::ModResourceResp;
type ResponseStream = T::WatchResourceStream;
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 ModManager>::watch_resource(&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 = WatchResourceSvc(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(
tonic::body::Body::default(),
);
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 ModManagerServer<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 = "bilibili.broadcast.v1.ModManager";
impl<T> tonic::server::NamedService for ModManagerServer<T> {
const NAME: &'static str = SERVICE_NAME;
}
}
#[cfg(feature = "feat-enable-generated-server")]
pub mod push_server {
#![allow(
unused_variables,
dead_code,
missing_docs,
clippy::wildcard_imports,
clippy::let_unit_value,
)]
use tonic::codegen::*;
#[async_trait]
pub trait Push: std::marker::Send + std::marker::Sync + 'static {
type WatchMessageStream: tonic::codegen::tokio_stream::Stream<
Item = std::result::Result<super::PushMessageResp, tonic::Status>,
>
+ std::marker::Send
+ 'static;
async fn watch_message(
&self,
request: tonic::Request<()>,
) -> std::result::Result<
tonic::Response<Self::WatchMessageStream>,
tonic::Status,
>;
}
#[derive(Debug)]
pub struct PushServer<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> PushServer<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 PushServer<T>
where
T: Push,
B: Body + std::marker::Send + 'static,
B::Error: Into<StdError> + std::marker::Send + 'static,
{
type Response = http::Response<tonic::body::Body>;
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() {
"/bilibili.broadcast.v1.Push/WatchMessage" => {
#[allow(non_camel_case_types)]
struct WatchMessageSvc<T: Push>(pub Arc<T>);
impl<T: Push> tonic::server::ServerStreamingService<()>
for WatchMessageSvc<T> {
type Response = super::PushMessageResp;
type ResponseStream = T::WatchMessageStream;
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 Push>::watch_message(&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 = WatchMessageSvc(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(
tonic::body::Body::default(),
);
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 PushServer<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 = "bilibili.broadcast.v1.Push";
impl<T> tonic::server::NamedService for PushServer<T> {
const NAME: &'static str = SERVICE_NAME;
}
}
#[cfg(feature = "feat-enable-generated-server")]
pub mod test2_server {
#![allow(
unused_variables,
dead_code,
missing_docs,
clippy::wildcard_imports,
clippy::let_unit_value,
)]
use tonic::codegen::*;
#[async_trait]
pub trait Test2: std::marker::Send + std::marker::Sync + 'static {
async fn test(
&self,
request: tonic::Request<tonic::Streaming<super::AddParams>>,
) -> std::result::Result<tonic::Response<()>, tonic::Status>;
}
#[derive(Debug)]
pub struct Test2Server<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> Test2Server<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 Test2Server<T>
where
T: Test2,
B: Body + std::marker::Send + 'static,
B::Error: Into<StdError> + std::marker::Send + 'static,
{
type Response = http::Response<tonic::body::Body>;
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() {
"/bilibili.broadcast.v1.Test2/Test" => {
#[allow(non_camel_case_types)]
struct TestSvc<T: Test2>(pub Arc<T>);
impl<
T: Test2,
> tonic::server::ClientStreamingService<super::AddParams>
for TestSvc<T> {
type Response = ();
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<tonic::Streaming<super::AddParams>>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as Test2>::test(&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 = TestSvc(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.client_streaming(method, req).await;
Ok(res)
};
Box::pin(fut)
}
_ => {
Box::pin(async move {
let mut response = http::Response::new(
tonic::body::Body::default(),
);
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 Test2Server<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 = "bilibili.broadcast.v1.Test2";
impl<T> tonic::server::NamedService for Test2Server<T> {
const NAME: &'static str = SERVICE_NAME;
}
}