#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Animate {
#[prost(string, tag = "1")]
pub icon: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub json: ::prost::alloc::string::String,
#[prost(string, tag = "3")]
pub svg: ::prost::alloc::string::String,
#[prost(int32, tag = "4")]
pub r#loop: i32,
}
impl ::prost::Name for Animate {
const NAME: &'static str = "Animate";
const PACKAGE: &'static str = "bilibili.broadcast.message.main";
fn full_name() -> ::prost::alloc::string::String {
"bilibili.broadcast.message.main.Animate".into()
}
fn type_url() -> ::prost::alloc::string::String {
"/bilibili.broadcast.message.main.Animate".into()
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ArticleCard {
#[prost(string, tag = "1")]
pub title: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub desc: ::prost::alloc::string::String,
#[prost(string, tag = "3")]
pub cover: ::prost::alloc::string::String,
#[prost(string, tag = "4")]
pub author: ::prost::alloc::string::String,
#[prost(int64, tag = "5")]
pub mid: i64,
#[prost(int32, tag = "6")]
pub view: i32,
#[prost(int32, tag = "7")]
pub like: i32,
#[prost(int32, tag = "8")]
pub reply: i32,
#[prost(string, tag = "9")]
pub pub_time: ::prost::alloc::string::String,
#[prost(string, tag = "10")]
pub badge: ::prost::alloc::string::String,
}
impl ::prost::Name for ArticleCard {
const NAME: &'static str = "ArticleCard";
const PACKAGE: &'static str = "bilibili.broadcast.message.main";
fn full_name() -> ::prost::alloc::string::String {
"bilibili.broadcast.message.main.ArticleCard".into()
}
fn type_url() -> ::prost::alloc::string::String {
"/bilibili.broadcast.message.main.ArticleCard".into()
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Bubble {
#[prost(message, repeated, tag = "1")]
pub paragraphs: ::prost::alloc::vec::Vec<
super::super::super::app::dynamic::v2::Paragraph,
>,
#[prost(message, repeated, tag = "2")]
pub item: ::prost::alloc::vec::Vec<CardItem>,
}
impl ::prost::Name for Bubble {
const NAME: &'static str = "Bubble";
const PACKAGE: &'static str = "bilibili.broadcast.message.main";
fn full_name() -> ::prost::alloc::string::String {
"bilibili.broadcast.message.main.Bubble".into()
}
fn type_url() -> ::prost::alloc::string::String {
"/bilibili.broadcast.message.main.Bubble".into()
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CardItem {
#[prost(string, tag = "1")]
pub uri: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub param: ::prost::alloc::string::String,
#[prost(string, tag = "3")]
pub goto: ::prost::alloc::string::String,
#[prost(oneof = "card_item::CardItem", tags = "4, 5")]
pub card_item: ::core::option::Option<card_item::CardItem>,
}
pub mod card_item {
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum CardItem {
#[prost(message, tag = "4")]
Article(super::ArticleCard),
#[prost(message, tag = "5")]
Av(super::VideoCard),
}
}
impl ::prost::Name for CardItem {
const NAME: &'static str = "CardItem";
const PACKAGE: &'static str = "bilibili.broadcast.message.main";
fn full_name() -> ::prost::alloc::string::String {
"bilibili.broadcast.message.main.CardItem".into()
}
fn type_url() -> ::prost::alloc::string::String {
"/bilibili.broadcast.message.main.CardItem".into()
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ChatResult {
#[prost(int32, tag = "1")]
pub code: i32,
#[prost(string, tag = "2")]
pub session_id: ::prost::alloc::string::String,
#[prost(message, repeated, tag = "3")]
pub bubbles: ::prost::alloc::vec::Vec<Bubble>,
#[prost(string, tag = "4")]
pub rewrite_word: ::prost::alloc::string::String,
#[prost(string, tag = "5")]
pub title: ::prost::alloc::string::String,
#[prost(string, tag = "6")]
pub business: ::prost::alloc::string::String,
#[prost(int64, tag = "7")]
pub message_id: i64,
#[prost(enumeration = "LikeState", tag = "8")]
pub like_state: i32,
#[prost(int64, tag = "9")]
pub like_number: i64,
}
impl ::prost::Name for ChatResult {
const NAME: &'static str = "ChatResult";
const PACKAGE: &'static str = "bilibili.broadcast.message.main";
fn full_name() -> ::prost::alloc::string::String {
"bilibili.broadcast.message.main.ChatResult".into()
}
fn type_url() -> ::prost::alloc::string::String {
"/bilibili.broadcast.message.main.ChatResult".into()
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CommandDm {
#[prost(int64, tag = "1")]
pub id: i64,
#[prost(int64, tag = "2")]
pub oid: i64,
#[prost(int64, tag = "3")]
pub mid: i64,
#[prost(int32, tag = "4")]
pub r#type: i32,
#[prost(string, tag = "5")]
pub command: ::prost::alloc::string::String,
#[prost(string, tag = "6")]
pub content: ::prost::alloc::string::String,
#[prost(int32, tag = "7")]
pub state: i32,
#[prost(int32, tag = "8")]
pub progress: i32,
#[prost(string, tag = "9")]
pub ctime: ::prost::alloc::string::String,
#[prost(string, tag = "10")]
pub mtime: ::prost::alloc::string::String,
#[prost(string, tag = "11")]
pub extra: ::prost::alloc::string::String,
#[prost(string, tag = "12")]
pub id_str: ::prost::alloc::string::String,
}
impl ::prost::Name for CommandDm {
const NAME: &'static str = "CommandDm";
const PACKAGE: &'static str = "bilibili.broadcast.message.main";
fn full_name() -> ::prost::alloc::string::String {
"bilibili.broadcast.message.main.CommandDm".into()
}
fn type_url() -> ::prost::alloc::string::String {
"/bilibili.broadcast.message.main.CommandDm".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(string, tag = "9")]
pub action: ::prost::alloc::string::String,
#[prost(int32, tag = "10")]
pub pool: i32,
#[prost(string, tag = "11")]
pub id_str: ::prost::alloc::string::String,
#[prost(int32, tag = "12")]
pub weight: i32,
#[prost(int32, tag = "13")]
pub attr: i32,
#[prost(string, tag = "14")]
pub animation: ::prost::alloc::string::String,
}
impl ::prost::Name for DanmakuElem {
const NAME: &'static str = "DanmakuElem";
const PACKAGE: &'static str = "bilibili.broadcast.message.main";
fn full_name() -> ::prost::alloc::string::String {
"bilibili.broadcast.message.main.DanmakuElem".into()
}
fn type_url() -> ::prost::alloc::string::String {
"/bilibili.broadcast.message.main.DanmakuElem".into()
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DanmukuEvent {
#[prost(message, repeated, tag = "1")]
pub elems: ::prost::alloc::vec::Vec<DanmakuElem>,
}
impl ::prost::Name for DanmukuEvent {
const NAME: &'static str = "DanmukuEvent";
const PACKAGE: &'static str = "bilibili.broadcast.message.main";
fn full_name() -> ::prost::alloc::string::String {
"bilibili.broadcast.message.main.DanmukuEvent".into()
}
fn type_url() -> ::prost::alloc::string::String {
"/bilibili.broadcast.message.main.DanmukuEvent".into()
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct EventItem {
#[prost(int64, tag = "1")]
pub item_i_d: i64,
#[prost(string, tag = "2")]
pub r#type: ::prost::alloc::string::String,
#[prost(int64, tag = "3")]
pub num: i64,
#[prost(string, tag = "4")]
pub display_num: ::prost::alloc::string::String,
#[prost(string, tag = "5")]
pub web_key: ::prost::alloc::string::String,
#[prost(int64, tag = "6")]
pub dimension: i64,
}
impl ::prost::Name for EventItem {
const NAME: &'static str = "EventItem";
const PACKAGE: &'static str = "bilibili.broadcast.message.main";
fn full_name() -> ::prost::alloc::string::String {
"bilibili.broadcast.message.main.EventItem".into()
}
fn type_url() -> ::prost::alloc::string::String {
"/bilibili.broadcast.message.main.EventItem".into()
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct HistoryReportEvent {
#[prost(int64, tag = "1")]
pub aid: i64,
#[prost(int32, tag = "2")]
pub r#type: i32,
#[prost(int64, tag = "3")]
pub cid: i64,
#[prost(int64, tag = "4")]
pub epid: i64,
#[prost(int64, tag = "5")]
pub sid: i64,
#[prost(int32, tag = "6")]
pub sub_type: i32,
#[prost(int32, tag = "7")]
pub dt: i32,
#[prost(int64, tag = "8")]
pub realtime: i64,
#[prost(string, tag = "9")]
pub source: ::prost::alloc::string::String,
#[prost(int64, tag = "10")]
pub progress: i64,
#[prost(int64, tag = "11")]
pub duration: i64,
#[prost(string, tag = "12")]
pub platform: ::prost::alloc::string::String,
#[prost(string, tag = "13")]
pub device: ::prost::alloc::string::String,
#[prost(int64, tag = "14")]
pub play_time: i64,
#[prost(string, tag = "15")]
pub statistics: ::prost::alloc::string::String,
#[prost(int64, tag = "16")]
pub start_ts: i64,
#[prost(int64, tag = "17")]
pub device_ts: i64,
#[prost(string, tag = "18")]
pub scene: ::prost::alloc::string::String,
}
impl ::prost::Name for HistoryReportEvent {
const NAME: &'static str = "HistoryReportEvent";
const PACKAGE: &'static str = "bilibili.broadcast.message.main";
fn full_name() -> ::prost::alloc::string::String {
"bilibili.broadcast.message.main.HistoryReportEvent".into()
}
fn type_url() -> ::prost::alloc::string::String {
"/bilibili.broadcast.message.main.HistoryReportEvent".into()
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct NativePageEvent {
#[prost(int64, tag = "1")]
pub page_i_d: i64,
#[prost(message, repeated, tag = "2")]
pub items: ::prost::alloc::vec::Vec<EventItem>,
}
impl ::prost::Name for NativePageEvent {
const NAME: &'static str = "NativePageEvent";
const PACKAGE: &'static str = "bilibili.broadcast.message.main";
fn full_name() -> ::prost::alloc::string::String {
"bilibili.broadcast.message.main.NativePageEvent".into()
}
fn type_url() -> ::prost::alloc::string::String {
"/bilibili.broadcast.message.main.NativePageEvent".into()
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ReasonStyle {
#[prost(string, tag = "1")]
pub text: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub text_color: ::prost::alloc::string::String,
#[prost(string, tag = "3")]
pub text_color_night: ::prost::alloc::string::String,
#[prost(string, tag = "4")]
pub bg_color: ::prost::alloc::string::String,
#[prost(string, tag = "5")]
pub bg_color_night: ::prost::alloc::string::String,
#[prost(string, tag = "6")]
pub border_color: ::prost::alloc::string::String,
#[prost(string, tag = "7")]
pub border_color_night: ::prost::alloc::string::String,
#[prost(int32, tag = "8")]
pub bg_style: i32,
}
impl ::prost::Name for ReasonStyle {
const NAME: &'static str = "ReasonStyle";
const PACKAGE: &'static str = "bilibili.broadcast.message.main";
fn full_name() -> ::prost::alloc::string::String {
"bilibili.broadcast.message.main.ReasonStyle".into()
}
fn type_url() -> ::prost::alloc::string::String {
"/bilibili.broadcast.message.main.ReasonStyle".into()
}
}
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct RedDot {
#[prost(int32, tag = "1")]
pub r#type: i32,
#[prost(int32, tag = "2")]
pub number: i32,
}
impl ::prost::Name for RedDot {
const NAME: &'static str = "RedDot";
const PACKAGE: &'static str = "bilibili.broadcast.message.main";
fn full_name() -> ::prost::alloc::string::String {
"bilibili.broadcast.message.main.RedDot".into()
}
fn type_url() -> ::prost::alloc::string::String {
"/bilibili.broadcast.message.main.RedDot".into()
}
}
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct Stats {
#[prost(int32, tag = "1")]
pub like: i32,
#[prost(int32, tag = "2")]
pub coin: i32,
#[prost(int32, tag = "3")]
pub fav: i32,
#[prost(int32, tag = "4")]
pub share: i32,
}
impl ::prost::Name for Stats {
const NAME: &'static str = "Stats";
const PACKAGE: &'static str = "bilibili.broadcast.message.main";
fn full_name() -> ::prost::alloc::string::String {
"bilibili.broadcast.message.main.Stats".into()
}
fn type_url() -> ::prost::alloc::string::String {
"/bilibili.broadcast.message.main.Stats".into()
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct TopActivityReply {
#[prost(message, optional, tag = "1")]
pub online: ::core::option::Option<TopOnline>,
#[prost(string, tag = "2")]
pub hash: ::prost::alloc::string::String,
}
impl ::prost::Name for TopActivityReply {
const NAME: &'static str = "TopActivityReply";
const PACKAGE: &'static str = "bilibili.broadcast.message.main";
fn full_name() -> ::prost::alloc::string::String {
"bilibili.broadcast.message.main.TopActivityReply".into()
}
fn type_url() -> ::prost::alloc::string::String {
"/bilibili.broadcast.message.main.TopActivityReply".into()
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct TopOnline {
#[prost(int32, tag = "1")]
pub r#type: i32,
#[prost(string, tag = "2")]
pub icon: ::prost::alloc::string::String,
#[prost(string, tag = "3")]
pub uri: ::prost::alloc::string::String,
#[prost(string, tag = "4")]
pub unique_id: ::prost::alloc::string::String,
#[prost(message, optional, tag = "5")]
pub animate: ::core::option::Option<Animate>,
#[prost(message, optional, tag = "6")]
pub red_dot: ::core::option::Option<RedDot>,
#[prost(string, tag = "7")]
pub name: ::prost::alloc::string::String,
#[prost(int64, tag = "8")]
pub interval: i64,
}
impl ::prost::Name for TopOnline {
const NAME: &'static str = "TopOnline";
const PACKAGE: &'static str = "bilibili.broadcast.message.main";
fn full_name() -> ::prost::alloc::string::String {
"bilibili.broadcast.message.main.TopOnline".into()
}
fn type_url() -> ::prost::alloc::string::String {
"/bilibili.broadcast.message.main.TopOnline".into()
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct VideoCard {
#[prost(string, tag = "1")]
pub title: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub desc: ::prost::alloc::string::String,
#[prost(string, tag = "3")]
pub cover: ::prost::alloc::string::String,
#[prost(string, tag = "4")]
pub author: ::prost::alloc::string::String,
#[prost(string, tag = "5")]
pub duration: ::prost::alloc::string::String,
#[prost(message, repeated, tag = "6")]
pub new_rec_tags: ::prost::alloc::vec::Vec<ReasonStyle>,
#[prost(message, repeated, tag = "7")]
pub badges: ::prost::alloc::vec::Vec<ReasonStyle>,
#[prost(string, tag = "8")]
pub show_card_desc2: ::prost::alloc::string::String,
#[prost(string, tag = "9")]
pub view_content: ::prost::alloc::string::String,
#[prost(int32, tag = "10")]
pub icon_type: i32,
}
impl ::prost::Name for VideoCard {
const NAME: &'static str = "VideoCard";
const PACKAGE: &'static str = "bilibili.broadcast.message.main";
fn full_name() -> ::prost::alloc::string::String {
"bilibili.broadcast.message.main.VideoCard".into()
}
fn type_url() -> ::prost::alloc::string::String {
"/bilibili.broadcast.message.main.VideoCard".into()
}
}
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct ViewPush {
#[prost(message, optional, tag = "1")]
pub stats: ::core::option::Option<Stats>,
#[prost(int64, tag = "2")]
pub aid: i64,
#[prost(int64, tag = "3")]
pub up_time: i64,
}
impl ::prost::Name for ViewPush {
const NAME: &'static str = "ViewPush";
const PACKAGE: &'static str = "bilibili.broadcast.message.main";
fn full_name() -> ::prost::alloc::string::String {
"bilibili.broadcast.message.main.ViewPush".into()
}
fn type_url() -> ::prost::alloc::string::String {
"/bilibili.broadcast.message.main.ViewPush".into()
}
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum LikeState {
Default = 0,
Like = 1,
Dislike = 2,
}
impl LikeState {
pub fn as_str_name(&self) -> &'static str {
match self {
Self::Default => "DEFAULT",
Self::Like => "LIKE",
Self::Dislike => "DISLIKE",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"DEFAULT" => Some(Self::Default),
"LIKE" => Some(Self::Like),
"DISLIKE" => Some(Self::Dislike),
_ => None,
}
}
}
#[cfg(feature = "feat-enable-generated-client")]
pub mod native_page_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 NativePageClient<T> {
inner: tonic::client::Grpc<T>,
}
impl<T> NativePageClient<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,
) -> NativePageClient<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,
{
NativePageClient::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_notify(
&mut self,
request: impl tonic::IntoRequest<()>,
) -> std::result::Result<
tonic::Response<tonic::codec::Streaming<super::NativePageEvent>>,
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.main.NativePage/WatchNotify",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"bilibili.broadcast.message.main.NativePage",
"WatchNotify",
),
);
self.inner.server_streaming(req, path, codec).await
}
}
}
#[cfg(feature = "feat-enable-generated-client")]
pub mod resource_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 ResourceClient<T> {
inner: tonic::client::Grpc<T>,
}
impl<T> ResourceClient<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,
) -> ResourceClient<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,
{
ResourceClient::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 top_activity(
&mut self,
request: impl tonic::IntoRequest<()>,
) -> std::result::Result<
tonic::Response<tonic::codec::Streaming<super::TopActivityReply>>,
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.main.Resource/TopActivity",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"bilibili.broadcast.message.main.Resource",
"TopActivity",
),
);
self.inner.server_streaming(req, path, codec).await
}
}
}
#[cfg(feature = "feat-enable-generated-client")]
pub mod search_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 SearchClient<T> {
inner: tonic::client::Grpc<T>,
}
impl<T> SearchClient<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,
) -> SearchClient<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,
{
SearchClient::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 chat_result_push(
&mut self,
request: impl tonic::IntoRequest<()>,
) -> std::result::Result<
tonic::Response<tonic::codec::Streaming<super::ChatResult>>,
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.main.Search/ChatResultPush",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"bilibili.broadcast.message.main.Search",
"ChatResultPush",
),
);
self.inner.server_streaming(req, path, codec).await
}
}
}
#[cfg(feature = "feat-enable-generated-server")]
pub mod native_page_server {
#![allow(
unused_variables,
dead_code,
missing_docs,
clippy::wildcard_imports,
clippy::let_unit_value,
)]
use tonic::codegen::*;
#[async_trait]
pub trait NativePage: std::marker::Send + std::marker::Sync + 'static {
type WatchNotifyStream: tonic::codegen::tokio_stream::Stream<
Item = std::result::Result<super::NativePageEvent, tonic::Status>,
>
+ std::marker::Send
+ 'static;
async fn watch_notify(
&self,
request: tonic::Request<()>,
) -> std::result::Result<
tonic::Response<Self::WatchNotifyStream>,
tonic::Status,
>;
}
#[derive(Debug)]
pub struct NativePageServer<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> NativePageServer<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 NativePageServer<T>
where
T: NativePage,
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.main.NativePage/WatchNotify" => {
#[allow(non_camel_case_types)]
struct WatchNotifySvc<T: NativePage>(pub Arc<T>);
impl<T: NativePage> tonic::server::ServerStreamingService<()>
for WatchNotifySvc<T> {
type Response = super::NativePageEvent;
type ResponseStream = T::WatchNotifyStream;
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 NativePage>::watch_notify(&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 = WatchNotifySvc(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 NativePageServer<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.main.NativePage";
impl<T> tonic::server::NamedService for NativePageServer<T> {
const NAME: &'static str = SERVICE_NAME;
}
}
#[cfg(feature = "feat-enable-generated-server")]
pub mod resource_server {
#![allow(
unused_variables,
dead_code,
missing_docs,
clippy::wildcard_imports,
clippy::let_unit_value,
)]
use tonic::codegen::*;
#[async_trait]
pub trait Resource: std::marker::Send + std::marker::Sync + 'static {
type TopActivityStream: tonic::codegen::tokio_stream::Stream<
Item = std::result::Result<super::TopActivityReply, tonic::Status>,
>
+ std::marker::Send
+ 'static;
async fn top_activity(
&self,
request: tonic::Request<()>,
) -> std::result::Result<
tonic::Response<Self::TopActivityStream>,
tonic::Status,
>;
}
#[derive(Debug)]
pub struct ResourceServer<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> ResourceServer<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 ResourceServer<T>
where
T: Resource,
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.main.Resource/TopActivity" => {
#[allow(non_camel_case_types)]
struct TopActivitySvc<T: Resource>(pub Arc<T>);
impl<T: Resource> tonic::server::ServerStreamingService<()>
for TopActivitySvc<T> {
type Response = super::TopActivityReply;
type ResponseStream = T::TopActivityStream;
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 Resource>::top_activity(&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 = TopActivitySvc(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 ResourceServer<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.main.Resource";
impl<T> tonic::server::NamedService for ResourceServer<T> {
const NAME: &'static str = SERVICE_NAME;
}
}
#[cfg(feature = "feat-enable-generated-server")]
pub mod search_server {
#![allow(
unused_variables,
dead_code,
missing_docs,
clippy::wildcard_imports,
clippy::let_unit_value,
)]
use tonic::codegen::*;
#[async_trait]
pub trait Search: std::marker::Send + std::marker::Sync + 'static {
type ChatResultPushStream: tonic::codegen::tokio_stream::Stream<
Item = std::result::Result<super::ChatResult, tonic::Status>,
>
+ std::marker::Send
+ 'static;
async fn chat_result_push(
&self,
request: tonic::Request<()>,
) -> std::result::Result<
tonic::Response<Self::ChatResultPushStream>,
tonic::Status,
>;
}
#[derive(Debug)]
pub struct SearchServer<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> SearchServer<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 SearchServer<T>
where
T: Search,
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.main.Search/ChatResultPush" => {
#[allow(non_camel_case_types)]
struct ChatResultPushSvc<T: Search>(pub Arc<T>);
impl<T: Search> tonic::server::ServerStreamingService<()>
for ChatResultPushSvc<T> {
type Response = super::ChatResult;
type ResponseStream = T::ChatResultPushStream;
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 Search>::chat_result_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 = ChatResultPushSvc(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 SearchServer<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.main.Search";
impl<T> tonic::server::NamedService for SearchServer<T> {
const NAME: &'static str = SERVICE_NAME;
}
}