#[derive(Clone, PartialEq, ::prost::Message)]
pub struct AccountNotify {
#[prost(string, tag = "1")]
pub biz: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub data: ::prost::alloc::string::String,
}
impl ::prost::Name for AccountNotify {
const NAME: &'static str = "AccountNotify";
const PACKAGE: &'static str = "bilibili.broadcast.message.tv";
fn full_name() -> ::prost::alloc::string::String {
"bilibili.broadcast.message.tv.AccountNotify".into()
}
fn type_url() -> ::prost::alloc::string::String {
"/bilibili.broadcast.message.tv.AccountNotify".into()
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CommonPushNotify {
#[prost(string, tag = "1")]
pub cmd: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub data: ::prost::alloc::string::String,
}
impl ::prost::Name for CommonPushNotify {
const NAME: &'static str = "CommonPushNotify";
const PACKAGE: &'static str = "bilibili.broadcast.message.tv";
fn full_name() -> ::prost::alloc::string::String {
"bilibili.broadcast.message.tv.CommonPushNotify".into()
}
fn type_url() -> ::prost::alloc::string::String {
"/bilibili.broadcast.message.tv.CommonPushNotify".into()
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DanmakuElem {
#[prost(int64, tag = "1")]
pub id: i64,
#[prost(int32, tag = "2")]
pub progress: i32,
#[prost(int32, tag = "3")]
pub mode: i32,
#[prost(int32, tag = "4")]
pub fontsize: i32,
#[prost(int32, tag = "5")]
pub color: i32,
#[prost(string, tag = "6")]
pub mid_hash: ::prost::alloc::string::String,
#[prost(string, tag = "7")]
pub content: ::prost::alloc::string::String,
#[prost(int64, tag = "8")]
pub ctime: i64,
#[prost(int32, tag = "9")]
pub weight: i32,
#[prost(string, tag = "10")]
pub action: ::prost::alloc::string::String,
#[prost(int32, tag = "11")]
pub pool: i32,
#[prost(string, tag = "12")]
pub id_str: ::prost::alloc::string::String,
#[prost(int32, tag = "13")]
pub attr: i32,
}
impl ::prost::Name for DanmakuElem {
const NAME: &'static str = "DanmakuElem";
const PACKAGE: &'static str = "bilibili.broadcast.message.tv";
fn full_name() -> ::prost::alloc::string::String {
"bilibili.broadcast.message.tv.DanmakuElem".into()
}
fn type_url() -> ::prost::alloc::string::String {
"/bilibili.broadcast.message.tv.DanmakuElem".into()
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DmLiveElem {
#[prost(int64, tag = "1")]
pub room_id: i64,
#[prost(int64, tag = "2")]
pub room_uid: i64,
#[prost(int64, tag = "3")]
pub uid: i64,
#[prost(string, tag = "4")]
pub uname: ::prost::alloc::string::String,
#[prost(int32, tag = "5")]
pub user_level: i32,
#[prost(int32, tag = "6")]
pub color: i32,
#[prost(string, tag = "7")]
pub content: ::prost::alloc::string::String,
#[prost(int64, tag = "8")]
pub time: i64,
#[prost(string, tag = "9")]
pub msg_id: ::prost::alloc::string::String,
#[prost(int32, tag = "10")]
pub msg_type: i32,
#[prost(int32, tag = "11")]
pub area_id: i32,
#[prost(int32, tag = "12")]
pub parent_area_id: i32,
#[prost(int32, tag = "13")]
pub dm_type: i32,
#[prost(string, tag = "14")]
pub id_str: ::prost::alloc::string::String,
}
impl ::prost::Name for DmLiveElem {
const NAME: &'static str = "DmLiveElem";
const PACKAGE: &'static str = "bilibili.broadcast.message.tv";
fn full_name() -> ::prost::alloc::string::String {
"bilibili.broadcast.message.tv.DmLiveElem".into()
}
fn type_url() -> ::prost::alloc::string::String {
"/bilibili.broadcast.message.tv.DmLiveElem".into()
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DmLiveReply {
#[prost(message, repeated, tag = "1")]
pub elems: ::prost::alloc::vec::Vec<DmLiveElem>,
#[prost(int32, tag = "2")]
pub state: i32,
#[prost(int32, tag = "3")]
pub source: i32,
}
impl ::prost::Name for DmLiveReply {
const NAME: &'static str = "DmLiveReply";
const PACKAGE: &'static str = "bilibili.broadcast.message.tv";
fn full_name() -> ::prost::alloc::string::String {
"bilibili.broadcast.message.tv.DmLiveReply".into()
}
fn type_url() -> ::prost::alloc::string::String {
"/bilibili.broadcast.message.tv.DmLiveReply".into()
}
}
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct DmLiveSwitchReload {
#[prost(bool, tag = "1")]
pub reload: bool,
}
impl ::prost::Name for DmLiveSwitchReload {
const NAME: &'static str = "DmLiveSwitchReload";
const PACKAGE: &'static str = "bilibili.broadcast.message.tv";
fn full_name() -> ::prost::alloc::string::String {
"bilibili.broadcast.message.tv.DmLiveSwitchReload".into()
}
fn type_url() -> ::prost::alloc::string::String {
"/bilibili.broadcast.message.tv.DmLiveSwitchReload".into()
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DmSegLiveReply {
#[prost(message, repeated, tag = "1")]
pub elems: ::prost::alloc::vec::Vec<DanmakuElem>,
#[prost(int32, tag = "2")]
pub state: i32,
}
impl ::prost::Name for DmSegLiveReply {
const NAME: &'static str = "DmSegLiveReply";
const PACKAGE: &'static str = "bilibili.broadcast.message.tv";
fn full_name() -> ::prost::alloc::string::String {
"bilibili.broadcast.message.tv.DmSegLiveReply".into()
}
fn type_url() -> ::prost::alloc::string::String {
"/bilibili.broadcast.message.tv.DmSegLiveReply".into()
}
}
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct EsportsNotify {
#[prost(int64, tag = "1")]
pub cid: i64,
}
impl ::prost::Name for EsportsNotify {
const NAME: &'static str = "EsportsNotify";
const PACKAGE: &'static str = "bilibili.broadcast.message.tv";
fn full_name() -> ::prost::alloc::string::String {
"bilibili.broadcast.message.tv.EsportsNotify".into()
}
fn type_url() -> ::prost::alloc::string::String {
"/bilibili.broadcast.message.tv.EsportsNotify".into()
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct FeedClientSmartNotify {
#[prost(int64, tag = "1")]
pub mid: i64,
#[prost(string, tag = "2")]
pub cards: ::prost::alloc::string::String,
}
impl ::prost::Name for FeedClientSmartNotify {
const NAME: &'static str = "FeedClientSmartNotify";
const PACKAGE: &'static str = "bilibili.broadcast.message.tv";
fn full_name() -> ::prost::alloc::string::String {
"bilibili.broadcast.message.tv.FeedClientSmartNotify".into()
}
fn type_url() -> ::prost::alloc::string::String {
"/bilibili.broadcast.message.tv.FeedClientSmartNotify".into()
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct LiveBottomConfNotify {
#[prost(int64, tag = "1")]
pub room_id: i64,
#[prost(string, tag = "2")]
pub bottom_msg: ::prost::alloc::string::String,
}
impl ::prost::Name for LiveBottomConfNotify {
const NAME: &'static str = "LiveBottomConfNotify";
const PACKAGE: &'static str = "bilibili.broadcast.message.tv";
fn full_name() -> ::prost::alloc::string::String {
"bilibili.broadcast.message.tv.LiveBottomConfNotify".into()
}
fn type_url() -> ::prost::alloc::string::String {
"/bilibili.broadcast.message.tv.LiveBottomConfNotify".into()
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct LiveCommonNotify {
#[prost(string, tag = "1")]
pub cmd: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub data: ::prost::alloc::string::String,
}
impl ::prost::Name for LiveCommonNotify {
const NAME: &'static str = "LiveCommonNotify";
const PACKAGE: &'static str = "bilibili.broadcast.message.tv";
fn full_name() -> ::prost::alloc::string::String {
"bilibili.broadcast.message.tv.LiveCommonNotify".into()
}
fn type_url() -> ::prost::alloc::string::String {
"/bilibili.broadcast.message.tv.LiveCommonNotify".into()
}
}
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct LiveSkipNotify {
#[prost(int64, tag = "1")]
pub live_id: i64,
}
impl ::prost::Name for LiveSkipNotify {
const NAME: &'static str = "LiveSkipNotify";
const PACKAGE: &'static str = "bilibili.broadcast.message.tv";
fn full_name() -> ::prost::alloc::string::String {
"bilibili.broadcast.message.tv.LiveSkipNotify".into()
}
fn type_url() -> ::prost::alloc::string::String {
"/bilibili.broadcast.message.tv.LiveSkipNotify".into()
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct LiveStatusNotify {
#[prost(int64, tag = "1")]
pub status: i64,
#[prost(string, tag = "2")]
pub msg: ::prost::alloc::string::String,
#[prost(int64, tag = "3")]
pub cid: i64,
}
impl ::prost::Name for LiveStatusNotify {
const NAME: &'static str = "LiveStatusNotify";
const PACKAGE: &'static str = "bilibili.broadcast.message.tv";
fn full_name() -> ::prost::alloc::string::String {
"bilibili.broadcast.message.tv.LiveStatusNotify".into()
}
fn type_url() -> ::prost::alloc::string::String {
"/bilibili.broadcast.message.tv.LiveStatusNotify".into()
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct LiveViewerMsgNotify {
#[prost(int64, tag = "1")]
pub room_id: i64,
#[prost(string, tag = "2")]
pub viewer_msg: ::prost::alloc::string::String,
}
impl ::prost::Name for LiveViewerMsgNotify {
const NAME: &'static str = "LiveViewerMsgNotify";
const PACKAGE: &'static str = "bilibili.broadcast.message.tv";
fn full_name() -> ::prost::alloc::string::String {
"bilibili.broadcast.message.tv.LiveViewerMsgNotify".into()
}
fn type_url() -> ::prost::alloc::string::String {
"/bilibili.broadcast.message.tv.LiveViewerMsgNotify".into()
}
}
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct MainRedDotReply {
#[prost(int64, tag = "1")]
pub mid: i64,
#[prost(int64, tag = "2")]
pub reddot: i64,
}
impl ::prost::Name for MainRedDotReply {
const NAME: &'static str = "MainRedDotReply";
const PACKAGE: &'static str = "bilibili.broadcast.message.tv";
fn full_name() -> ::prost::alloc::string::String {
"bilibili.broadcast.message.tv.MainRedDotReply".into()
}
fn type_url() -> ::prost::alloc::string::String {
"/bilibili.broadcast.message.tv.MainRedDotReply".into()
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct NotifyPop {
#[prost(int64, tag = "1")]
pub id: i64,
#[prost(int32, tag = "2")]
pub style: i32,
#[prost(string, tag = "3")]
pub img: ::prost::alloc::string::String,
#[prost(int32, tag = "4")]
pub text_type: i32,
#[prost(string, tag = "5")]
pub text_top: ::prost::alloc::string::String,
#[prost(string, tag = "6")]
pub text_bottom: ::prost::alloc::string::String,
#[prost(int32, tag = "7")]
pub expire: i32,
#[prost(message, repeated, tag = "8")]
pub notify_btn_list: ::prost::alloc::vec::Vec<NotifyPopBtn>,
}
impl ::prost::Name for NotifyPop {
const NAME: &'static str = "NotifyPop";
const PACKAGE: &'static str = "bilibili.broadcast.message.tv";
fn full_name() -> ::prost::alloc::string::String {
"bilibili.broadcast.message.tv.NotifyPop".into()
}
fn type_url() -> ::prost::alloc::string::String {
"/bilibili.broadcast.message.tv.NotifyPop".into()
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct NotifyPopBtn {
#[prost(string, tag = "1")]
pub text: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub url: ::prost::alloc::string::String,
}
impl ::prost::Name for NotifyPopBtn {
const NAME: &'static str = "NotifyPopBtn";
const PACKAGE: &'static str = "bilibili.broadcast.message.tv";
fn full_name() -> ::prost::alloc::string::String {
"bilibili.broadcast.message.tv.NotifyPopBtn".into()
}
fn type_url() -> ::prost::alloc::string::String {
"/bilibili.broadcast.message.tv.NotifyPopBtn".into()
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct NotifyPopReply {
#[prost(int64, tag = "1")]
pub mid: i64,
#[prost(message, optional, tag = "2")]
pub notify: ::core::option::Option<NotifyPop>,
}
impl ::prost::Name for NotifyPopReply {
const NAME: &'static str = "NotifyPopReply";
const PACKAGE: &'static str = "bilibili.broadcast.message.tv";
fn full_name() -> ::prost::alloc::string::String {
"bilibili.broadcast.message.tv.NotifyPopReply".into()
}
fn type_url() -> ::prost::alloc::string::String {
"/bilibili.broadcast.message.tv.NotifyPopReply".into()
}
}
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct OgvPayOrderReply {
#[prost(int64, tag = "1")]
pub mid: i64,
#[prost(int64, tag = "2")]
pub season_id: i64,
}
impl ::prost::Name for OgvPayOrderReply {
const NAME: &'static str = "OgvPayOrderReply";
const PACKAGE: &'static str = "bilibili.broadcast.message.tv";
fn full_name() -> ::prost::alloc::string::String {
"bilibili.broadcast.message.tv.OgvPayOrderReply".into()
}
fn type_url() -> ::prost::alloc::string::String {
"/bilibili.broadcast.message.tv.OgvPayOrderReply".into()
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ProjLiveEventNotify {
#[prost(int64, tag = "1")]
pub room_id: i64,
#[prost(int64, tag = "2")]
pub event_type: i64,
#[prost(string, tag = "3")]
pub event_msg: ::prost::alloc::string::String,
}
impl ::prost::Name for ProjLiveEventNotify {
const NAME: &'static str = "ProjLiveEventNotify";
const PACKAGE: &'static str = "bilibili.broadcast.message.tv";
fn full_name() -> ::prost::alloc::string::String {
"bilibili.broadcast.message.tv.ProjLiveEventNotify".into()
}
fn type_url() -> ::prost::alloc::string::String {
"/bilibili.broadcast.message.tv.ProjLiveEventNotify".into()
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ProjReply {
#[prost(int64, tag = "1")]
pub cmd_type: i64,
#[prost(int64, tag = "2")]
pub mid: i64,
#[prost(int64, tag = "3")]
pub aid: i64,
#[prost(int64, tag = "4")]
pub cid: i64,
#[prost(int64, tag = "5")]
pub video_type: i64,
#[prost(int64, tag = "6")]
pub ep_id: i64,
#[prost(int64, tag = "7")]
pub season_id: i64,
#[prost(int64, tag = "8")]
pub seek_ts: i64,
#[prost(string, tag = "9")]
pub extra: ::prost::alloc::string::String,
#[prost(int64, tag = "10")]
pub room_id: i64,
#[prost(string, tag = "11")]
pub device_info: ::prost::alloc::string::String,
}
impl ::prost::Name for ProjReply {
const NAME: &'static str = "ProjReply";
const PACKAGE: &'static str = "bilibili.broadcast.message.tv";
fn full_name() -> ::prost::alloc::string::String {
"bilibili.broadcast.message.tv.ProjReply".into()
}
fn type_url() -> ::prost::alloc::string::String {
"/bilibili.broadcast.message.tv.ProjReply".into()
}
}
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct PublicityNotify {
#[prost(int64, tag = "1")]
pub publicity_id: i64,
#[prost(int64, tag = "2")]
pub room_id: i64,
#[prost(int64, tag = "3")]
pub status: i64,
}
impl ::prost::Name for PublicityNotify {
const NAME: &'static str = "PublicityNotify";
const PACKAGE: &'static str = "bilibili.broadcast.message.tv";
fn full_name() -> ::prost::alloc::string::String {
"bilibili.broadcast.message.tv.PublicityNotify".into()
}
fn type_url() -> ::prost::alloc::string::String {
"/bilibili.broadcast.message.tv.PublicityNotify".into()
}
}
#[cfg(feature = "feat-enable-generated-client")]
pub mod tv_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 TvClient<T> {
inner: tonic::client::Grpc<T>,
}
impl<T> TvClient<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,
) -> TvClient<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,
{
TvClient::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 account(
&mut self,
request: impl tonic::IntoRequest<()>,
) -> std::result::Result<
tonic::Response<tonic::codec::Streaming<super::AccountNotify>>,
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.message.tv.Tv/Account",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("bilibili.broadcast.message.tv.Tv", "Account"));
self.inner.server_streaming(req, path, codec).await
}
pub async fn common_push(
&mut self,
request: impl tonic::IntoRequest<()>,
) -> std::result::Result<
tonic::Response<tonic::codec::Streaming<super::CommonPushNotify>>,
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.message.tv.Tv/CommonPush",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new("bilibili.broadcast.message.tv.Tv", "CommonPush"),
);
self.inner.server_streaming(req, path, codec).await
}
pub async fn esports(
&mut self,
request: impl tonic::IntoRequest<()>,
) -> std::result::Result<
tonic::Response<tonic::codec::Streaming<super::EsportsNotify>>,
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.message.tv.Tv/Esports",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("bilibili.broadcast.message.tv.Tv", "Esports"));
self.inner.server_streaming(req, path, codec).await
}
pub async fn feed_client_smart(
&mut self,
request: impl tonic::IntoRequest<()>,
) -> std::result::Result<
tonic::Response<tonic::codec::Streaming<super::FeedClientSmartNotify>>,
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.message.tv.Tv/FeedClientSmart",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"bilibili.broadcast.message.tv.Tv",
"FeedClientSmart",
),
);
self.inner.server_streaming(req, path, codec).await
}
pub async fn live_bottom(
&mut self,
request: impl tonic::IntoRequest<()>,
) -> std::result::Result<
tonic::Response<tonic::codec::Streaming<super::LiveBottomConfNotify>>,
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.message.tv.Tv/LiveBottom",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new("bilibili.broadcast.message.tv.Tv", "LiveBottom"),
);
self.inner.server_streaming(req, path, codec).await
}
pub async fn live_common_msg(
&mut self,
request: impl tonic::IntoRequest<()>,
) -> std::result::Result<
tonic::Response<tonic::codec::Streaming<super::LiveCommonNotify>>,
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.message.tv.Tv/LiveCommonMsg",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new("bilibili.broadcast.message.tv.Tv", "LiveCommonMsg"),
);
self.inner.server_streaming(req, path, codec).await
}
pub async fn live_skip(
&mut self,
request: impl tonic::IntoRequest<()>,
) -> std::result::Result<
tonic::Response<tonic::codec::Streaming<super::LiveSkipNotify>>,
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.message.tv.Tv/LiveSkip",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("bilibili.broadcast.message.tv.Tv", "LiveSkip"));
self.inner.server_streaming(req, path, codec).await
}
pub async fn live_status(
&mut self,
request: impl tonic::IntoRequest<()>,
) -> std::result::Result<
tonic::Response<tonic::codec::Streaming<super::LiveStatusNotify>>,
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.message.tv.Tv/LiveStatus",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new("bilibili.broadcast.message.tv.Tv", "LiveStatus"),
);
self.inner.server_streaming(req, path, codec).await
}
pub async fn main_red_dot(
&mut self,
request: impl tonic::IntoRequest<()>,
) -> std::result::Result<
tonic::Response<tonic::codec::Streaming<super::MainRedDotReply>>,
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.message.tv.Tv/MainRedDot",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new("bilibili.broadcast.message.tv.Tv", "MainRedDot"),
);
self.inner.server_streaming(req, path, codec).await
}
pub async fn notify_pop(
&mut self,
request: impl tonic::IntoRequest<()>,
) -> std::result::Result<
tonic::Response<tonic::codec::Streaming<super::NotifyPopReply>>,
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.message.tv.Tv/NotifyPop",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new("bilibili.broadcast.message.tv.Tv", "NotifyPop"),
);
self.inner.server_streaming(req, path, codec).await
}
pub async fn ogv_pay_order(
&mut self,
request: impl tonic::IntoRequest<()>,
) -> std::result::Result<
tonic::Response<tonic::codec::Streaming<super::OgvPayOrderReply>>,
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.message.tv.Tv/OgvPayOrder",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new("bilibili.broadcast.message.tv.Tv", "OgvPayOrder"),
);
self.inner.server_streaming(req, path, codec).await
}
pub async fn proj(
&mut self,
request: impl tonic::IntoRequest<()>,
) -> std::result::Result<
tonic::Response<tonic::codec::Streaming<super::ProjReply>>,
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.message.tv.Tv/Proj",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("bilibili.broadcast.message.tv.Tv", "Proj"));
self.inner.server_streaming(req, path, codec).await
}
pub async fn proj_core(
&mut self,
request: impl tonic::IntoRequest<()>,
) -> std::result::Result<
tonic::Response<tonic::codec::Streaming<super::ProjReply>>,
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.message.tv.Tv/ProjCore",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("bilibili.broadcast.message.tv.Tv", "ProjCore"));
self.inner.server_streaming(req, path, codec).await
}
pub async fn proj_live_event(
&mut self,
request: impl tonic::IntoRequest<()>,
) -> std::result::Result<
tonic::Response<tonic::codec::Streaming<super::ProjLiveEventNotify>>,
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.message.tv.Tv/ProjLiveEvent",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new("bilibili.broadcast.message.tv.Tv", "ProjLiveEvent"),
);
self.inner.server_streaming(req, path, codec).await
}
pub async fn publicity(
&mut self,
request: impl tonic::IntoRequest<()>,
) -> std::result::Result<
tonic::Response<tonic::codec::Streaming<super::PublicityNotify>>,
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.message.tv.Tv/Publicity",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new("bilibili.broadcast.message.tv.Tv", "Publicity"),
);
self.inner.server_streaming(req, path, codec).await
}
pub async fn viewer_num_msg(
&mut self,
request: impl tonic::IntoRequest<()>,
) -> std::result::Result<
tonic::Response<tonic::codec::Streaming<super::LiveViewerMsgNotify>>,
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.message.tv.Tv/ViewerNumMsg",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new("bilibili.broadcast.message.tv.Tv", "ViewerNumMsg"),
);
self.inner.server_streaming(req, path, codec).await
}
}
}
#[cfg(feature = "feat-enable-generated-server")]
pub mod tv_server {
#![allow(
unused_variables,
dead_code,
missing_docs,
clippy::wildcard_imports,
clippy::let_unit_value,
)]
use tonic::codegen::*;
#[async_trait]
pub trait Tv: std::marker::Send + std::marker::Sync + 'static {
type AccountStream: tonic::codegen::tokio_stream::Stream<
Item = std::result::Result<super::AccountNotify, tonic::Status>,
>
+ std::marker::Send
+ 'static;
async fn account(
&self,
request: tonic::Request<()>,
) -> std::result::Result<tonic::Response<Self::AccountStream>, tonic::Status>;
type CommonPushStream: tonic::codegen::tokio_stream::Stream<
Item = std::result::Result<super::CommonPushNotify, tonic::Status>,
>
+ std::marker::Send
+ 'static;
async fn common_push(
&self,
request: tonic::Request<()>,
) -> std::result::Result<tonic::Response<Self::CommonPushStream>, tonic::Status>;
type EsportsStream: tonic::codegen::tokio_stream::Stream<
Item = std::result::Result<super::EsportsNotify, tonic::Status>,
>
+ std::marker::Send
+ 'static;
async fn esports(
&self,
request: tonic::Request<()>,
) -> std::result::Result<tonic::Response<Self::EsportsStream>, tonic::Status>;
type FeedClientSmartStream: tonic::codegen::tokio_stream::Stream<
Item = std::result::Result<super::FeedClientSmartNotify, tonic::Status>,
>
+ std::marker::Send
+ 'static;
async fn feed_client_smart(
&self,
request: tonic::Request<()>,
) -> std::result::Result<
tonic::Response<Self::FeedClientSmartStream>,
tonic::Status,
>;
type LiveBottomStream: tonic::codegen::tokio_stream::Stream<
Item = std::result::Result<super::LiveBottomConfNotify, tonic::Status>,
>
+ std::marker::Send
+ 'static;
async fn live_bottom(
&self,
request: tonic::Request<()>,
) -> std::result::Result<tonic::Response<Self::LiveBottomStream>, tonic::Status>;
type LiveCommonMsgStream: tonic::codegen::tokio_stream::Stream<
Item = std::result::Result<super::LiveCommonNotify, tonic::Status>,
>
+ std::marker::Send
+ 'static;
async fn live_common_msg(
&self,
request: tonic::Request<()>,
) -> std::result::Result<
tonic::Response<Self::LiveCommonMsgStream>,
tonic::Status,
>;
type LiveSkipStream: tonic::codegen::tokio_stream::Stream<
Item = std::result::Result<super::LiveSkipNotify, tonic::Status>,
>
+ std::marker::Send
+ 'static;
async fn live_skip(
&self,
request: tonic::Request<()>,
) -> std::result::Result<tonic::Response<Self::LiveSkipStream>, tonic::Status>;
type LiveStatusStream: tonic::codegen::tokio_stream::Stream<
Item = std::result::Result<super::LiveStatusNotify, tonic::Status>,
>
+ std::marker::Send
+ 'static;
async fn live_status(
&self,
request: tonic::Request<()>,
) -> std::result::Result<tonic::Response<Self::LiveStatusStream>, tonic::Status>;
type MainRedDotStream: tonic::codegen::tokio_stream::Stream<
Item = std::result::Result<super::MainRedDotReply, tonic::Status>,
>
+ std::marker::Send
+ 'static;
async fn main_red_dot(
&self,
request: tonic::Request<()>,
) -> std::result::Result<tonic::Response<Self::MainRedDotStream>, tonic::Status>;
type NotifyPopStream: tonic::codegen::tokio_stream::Stream<
Item = std::result::Result<super::NotifyPopReply, tonic::Status>,
>
+ std::marker::Send
+ 'static;
async fn notify_pop(
&self,
request: tonic::Request<()>,
) -> std::result::Result<tonic::Response<Self::NotifyPopStream>, tonic::Status>;
type OgvPayOrderStream: tonic::codegen::tokio_stream::Stream<
Item = std::result::Result<super::OgvPayOrderReply, tonic::Status>,
>
+ std::marker::Send
+ 'static;
async fn ogv_pay_order(
&self,
request: tonic::Request<()>,
) -> std::result::Result<
tonic::Response<Self::OgvPayOrderStream>,
tonic::Status,
>;
type ProjStream: tonic::codegen::tokio_stream::Stream<
Item = std::result::Result<super::ProjReply, tonic::Status>,
>
+ std::marker::Send
+ 'static;
async fn proj(
&self,
request: tonic::Request<()>,
) -> std::result::Result<tonic::Response<Self::ProjStream>, tonic::Status>;
type ProjCoreStream: tonic::codegen::tokio_stream::Stream<
Item = std::result::Result<super::ProjReply, tonic::Status>,
>
+ std::marker::Send
+ 'static;
async fn proj_core(
&self,
request: tonic::Request<()>,
) -> std::result::Result<tonic::Response<Self::ProjCoreStream>, tonic::Status>;
type ProjLiveEventStream: tonic::codegen::tokio_stream::Stream<
Item = std::result::Result<super::ProjLiveEventNotify, tonic::Status>,
>
+ std::marker::Send
+ 'static;
async fn proj_live_event(
&self,
request: tonic::Request<()>,
) -> std::result::Result<
tonic::Response<Self::ProjLiveEventStream>,
tonic::Status,
>;
type PublicityStream: tonic::codegen::tokio_stream::Stream<
Item = std::result::Result<super::PublicityNotify, tonic::Status>,
>
+ std::marker::Send
+ 'static;
async fn publicity(
&self,
request: tonic::Request<()>,
) -> std::result::Result<tonic::Response<Self::PublicityStream>, tonic::Status>;
type ViewerNumMsgStream: tonic::codegen::tokio_stream::Stream<
Item = std::result::Result<super::LiveViewerMsgNotify, tonic::Status>,
>
+ std::marker::Send
+ 'static;
async fn viewer_num_msg(
&self,
request: tonic::Request<()>,
) -> std::result::Result<
tonic::Response<Self::ViewerNumMsgStream>,
tonic::Status,
>;
}
#[derive(Debug)]
pub struct TvServer<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> TvServer<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 TvServer<T>
where
T: Tv,
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.message.tv.Tv/Account" => {
#[allow(non_camel_case_types)]
struct AccountSvc<T: Tv>(pub Arc<T>);
impl<T: Tv> tonic::server::ServerStreamingService<()>
for AccountSvc<T> {
type Response = super::AccountNotify;
type ResponseStream = T::AccountStream;
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 Tv>::account(&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 = AccountSvc(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)
}
"/bilibili.broadcast.message.tv.Tv/CommonPush" => {
#[allow(non_camel_case_types)]
struct CommonPushSvc<T: Tv>(pub Arc<T>);
impl<T: Tv> tonic::server::ServerStreamingService<()>
for CommonPushSvc<T> {
type Response = super::CommonPushNotify;
type ResponseStream = T::CommonPushStream;
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 Tv>::common_push(&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 = CommonPushSvc(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)
}
"/bilibili.broadcast.message.tv.Tv/Esports" => {
#[allow(non_camel_case_types)]
struct EsportsSvc<T: Tv>(pub Arc<T>);
impl<T: Tv> tonic::server::ServerStreamingService<()>
for EsportsSvc<T> {
type Response = super::EsportsNotify;
type ResponseStream = T::EsportsStream;
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 Tv>::esports(&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 = EsportsSvc(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)
}
"/bilibili.broadcast.message.tv.Tv/FeedClientSmart" => {
#[allow(non_camel_case_types)]
struct FeedClientSmartSvc<T: Tv>(pub Arc<T>);
impl<T: Tv> tonic::server::ServerStreamingService<()>
for FeedClientSmartSvc<T> {
type Response = super::FeedClientSmartNotify;
type ResponseStream = T::FeedClientSmartStream;
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 Tv>::feed_client_smart(&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 = FeedClientSmartSvc(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)
}
"/bilibili.broadcast.message.tv.Tv/LiveBottom" => {
#[allow(non_camel_case_types)]
struct LiveBottomSvc<T: Tv>(pub Arc<T>);
impl<T: Tv> tonic::server::ServerStreamingService<()>
for LiveBottomSvc<T> {
type Response = super::LiveBottomConfNotify;
type ResponseStream = T::LiveBottomStream;
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 Tv>::live_bottom(&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 = LiveBottomSvc(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)
}
"/bilibili.broadcast.message.tv.Tv/LiveCommonMsg" => {
#[allow(non_camel_case_types)]
struct LiveCommonMsgSvc<T: Tv>(pub Arc<T>);
impl<T: Tv> tonic::server::ServerStreamingService<()>
for LiveCommonMsgSvc<T> {
type Response = super::LiveCommonNotify;
type ResponseStream = T::LiveCommonMsgStream;
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 Tv>::live_common_msg(&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 = LiveCommonMsgSvc(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)
}
"/bilibili.broadcast.message.tv.Tv/LiveSkip" => {
#[allow(non_camel_case_types)]
struct LiveSkipSvc<T: Tv>(pub Arc<T>);
impl<T: Tv> tonic::server::ServerStreamingService<()>
for LiveSkipSvc<T> {
type Response = super::LiveSkipNotify;
type ResponseStream = T::LiveSkipStream;
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 Tv>::live_skip(&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 = LiveSkipSvc(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)
}
"/bilibili.broadcast.message.tv.Tv/LiveStatus" => {
#[allow(non_camel_case_types)]
struct LiveStatusSvc<T: Tv>(pub Arc<T>);
impl<T: Tv> tonic::server::ServerStreamingService<()>
for LiveStatusSvc<T> {
type Response = super::LiveStatusNotify;
type ResponseStream = T::LiveStatusStream;
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 Tv>::live_status(&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 = LiveStatusSvc(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)
}
"/bilibili.broadcast.message.tv.Tv/MainRedDot" => {
#[allow(non_camel_case_types)]
struct MainRedDotSvc<T: Tv>(pub Arc<T>);
impl<T: Tv> tonic::server::ServerStreamingService<()>
for MainRedDotSvc<T> {
type Response = super::MainRedDotReply;
type ResponseStream = T::MainRedDotStream;
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 Tv>::main_red_dot(&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 = MainRedDotSvc(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)
}
"/bilibili.broadcast.message.tv.Tv/NotifyPop" => {
#[allow(non_camel_case_types)]
struct NotifyPopSvc<T: Tv>(pub Arc<T>);
impl<T: Tv> tonic::server::ServerStreamingService<()>
for NotifyPopSvc<T> {
type Response = super::NotifyPopReply;
type ResponseStream = T::NotifyPopStream;
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 Tv>::notify_pop(&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 = NotifyPopSvc(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)
}
"/bilibili.broadcast.message.tv.Tv/OgvPayOrder" => {
#[allow(non_camel_case_types)]
struct OgvPayOrderSvc<T: Tv>(pub Arc<T>);
impl<T: Tv> tonic::server::ServerStreamingService<()>
for OgvPayOrderSvc<T> {
type Response = super::OgvPayOrderReply;
type ResponseStream = T::OgvPayOrderStream;
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 Tv>::ogv_pay_order(&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 = OgvPayOrderSvc(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)
}
"/bilibili.broadcast.message.tv.Tv/Proj" => {
#[allow(non_camel_case_types)]
struct ProjSvc<T: Tv>(pub Arc<T>);
impl<T: Tv> tonic::server::ServerStreamingService<()>
for ProjSvc<T> {
type Response = super::ProjReply;
type ResponseStream = T::ProjStream;
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 Tv>::proj(&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 = ProjSvc(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)
}
"/bilibili.broadcast.message.tv.Tv/ProjCore" => {
#[allow(non_camel_case_types)]
struct ProjCoreSvc<T: Tv>(pub Arc<T>);
impl<T: Tv> tonic::server::ServerStreamingService<()>
for ProjCoreSvc<T> {
type Response = super::ProjReply;
type ResponseStream = T::ProjCoreStream;
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 Tv>::proj_core(&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 = ProjCoreSvc(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)
}
"/bilibili.broadcast.message.tv.Tv/ProjLiveEvent" => {
#[allow(non_camel_case_types)]
struct ProjLiveEventSvc<T: Tv>(pub Arc<T>);
impl<T: Tv> tonic::server::ServerStreamingService<()>
for ProjLiveEventSvc<T> {
type Response = super::ProjLiveEventNotify;
type ResponseStream = T::ProjLiveEventStream;
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 Tv>::proj_live_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 = ProjLiveEventSvc(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)
}
"/bilibili.broadcast.message.tv.Tv/Publicity" => {
#[allow(non_camel_case_types)]
struct PublicitySvc<T: Tv>(pub Arc<T>);
impl<T: Tv> tonic::server::ServerStreamingService<()>
for PublicitySvc<T> {
type Response = super::PublicityNotify;
type ResponseStream = T::PublicityStream;
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 Tv>::publicity(&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 = PublicitySvc(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)
}
"/bilibili.broadcast.message.tv.Tv/ViewerNumMsg" => {
#[allow(non_camel_case_types)]
struct ViewerNumMsgSvc<T: Tv>(pub Arc<T>);
impl<T: Tv> tonic::server::ServerStreamingService<()>
for ViewerNumMsgSvc<T> {
type Response = super::LiveViewerMsgNotify;
type ResponseStream = T::ViewerNumMsgStream;
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 Tv>::viewer_num_msg(&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 = ViewerNumMsgSvc(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 TvServer<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.message.tv.Tv";
impl<T> tonic::server::NamedService for TvServer<T> {
const NAME: &'static str = SERVICE_NAME;
}
}