#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct CancelChatTaskReply {
#[prost(int32, tag = "1")]
pub code: i32,
}
impl ::prost::Name for CancelChatTaskReply {
const NAME: &'static str = "CancelChatTaskReply";
const PACKAGE: &'static str = "bilibili.app.search.v2";
fn full_name() -> ::prost::alloc::string::String {
"bilibili.app.search.v2.CancelChatTaskReply".into()
}
fn type_url() -> ::prost::alloc::string::String {
"/bilibili.app.search.v2.CancelChatTaskReply".into()
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CancelChatTaskReq {
#[prost(string, tag = "1")]
pub session_id: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub from_source: ::prost::alloc::string::String,
}
impl ::prost::Name for CancelChatTaskReq {
const NAME: &'static str = "CancelChatTaskReq";
const PACKAGE: &'static str = "bilibili.app.search.v2";
fn full_name() -> ::prost::alloc::string::String {
"bilibili.app.search.v2.CancelChatTaskReq".into()
}
fn type_url() -> ::prost::alloc::string::String {
"/bilibili.app.search.v2.CancelChatTaskReq".into()
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetChatAuthReply {
#[prost(bool, tag = "1")]
pub display: bool,
#[prost(string, tag = "2")]
pub icon: ::prost::alloc::string::String,
#[prost(string, tag = "3")]
pub icon_night: ::prost::alloc::string::String,
#[prost(string, tag = "4")]
pub jump_link: ::prost::alloc::string::String,
#[prost(string, tag = "5")]
pub text_guide: ::prost::alloc::string::String,
#[prost(int32, tag = "6")]
pub jump_link_type: i32,
}
impl ::prost::Name for GetChatAuthReply {
const NAME: &'static str = "GetChatAuthReply";
const PACKAGE: &'static str = "bilibili.app.search.v2";
fn full_name() -> ::prost::alloc::string::String {
"bilibili.app.search.v2.GetChatAuthReply".into()
}
fn type_url() -> ::prost::alloc::string::String {
"/bilibili.app.search.v2.GetChatAuthReply".into()
}
}
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct GetChatAuthReq {}
impl ::prost::Name for GetChatAuthReq {
const NAME: &'static str = "GetChatAuthReq";
const PACKAGE: &'static str = "bilibili.app.search.v2";
fn full_name() -> ::prost::alloc::string::String {
"bilibili.app.search.v2.GetChatAuthReq".into()
}
fn type_url() -> ::prost::alloc::string::String {
"/bilibili.app.search.v2.GetChatAuthReq".into()
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetChatResultReq {
#[prost(string, tag = "1")]
pub query: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub session_id: ::prost::alloc::string::String,
#[prost(string, tag = "3")]
pub from_source: ::prost::alloc::string::String,
#[prost(string, tag = "4")]
pub track_id: ::prost::alloc::string::String,
}
impl ::prost::Name for GetChatResultReq {
const NAME: &'static str = "GetChatResultReq";
const PACKAGE: &'static str = "bilibili.app.search.v2";
fn full_name() -> ::prost::alloc::string::String {
"bilibili.app.search.v2.GetChatResultReq".into()
}
fn type_url() -> ::prost::alloc::string::String {
"/bilibili.app.search.v2.GetChatResultReq".into()
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct QueryRecAfterClickItem {
#[prost(string, tag = "1")]
pub show_name: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub recommend_reason: ::prost::alloc::string::String,
#[prost(int32, tag = "3")]
pub icon_type: i32,
#[prost(string, tag = "4")]
pub url: ::prost::alloc::string::String,
#[prost(string, tag = "5")]
pub icon: ::prost::alloc::string::String,
#[prost(string, tag = "6")]
pub icon_night: ::prost::alloc::string::String,
}
impl ::prost::Name for QueryRecAfterClickItem {
const NAME: &'static str = "QueryRecAfterClickItem";
const PACKAGE: &'static str = "bilibili.app.search.v2";
fn full_name() -> ::prost::alloc::string::String {
"bilibili.app.search.v2.QueryRecAfterClickItem".into()
}
fn type_url() -> ::prost::alloc::string::String {
"/bilibili.app.search.v2.QueryRecAfterClickItem".into()
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct QueryRecAfterClickReply {
#[prost(int32, tag = "1")]
pub code: i32,
#[prost(message, optional, tag = "2")]
pub query_rec_result: ::core::option::Option<QueryRecAfterClickResult>,
}
impl ::prost::Name for QueryRecAfterClickReply {
const NAME: &'static str = "QueryRecAfterClickReply";
const PACKAGE: &'static str = "bilibili.app.search.v2";
fn full_name() -> ::prost::alloc::string::String {
"bilibili.app.search.v2.QueryRecAfterClickReply".into()
}
fn type_url() -> ::prost::alloc::string::String {
"/bilibili.app.search.v2.QueryRecAfterClickReply".into()
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct QueryRecAfterClickReq {
#[prost(string, tag = "1")]
pub param: ::prost::alloc::string::String,
#[prost(int32, tag = "2")]
pub pos: i32,
#[prost(string, tag = "3")]
pub track_id: ::prost::alloc::string::String,
#[prost(string, tag = "4")]
pub qv_id: ::prost::alloc::string::String,
#[prost(string, tag = "5")]
pub keyword: ::prost::alloc::string::String,
#[prost(string, tag = "6")]
pub click_url: ::prost::alloc::string::String,
#[prost(string, tag = "7")]
pub from_source: ::prost::alloc::string::String,
#[prost(string, tag = "8")]
pub user_act: ::prost::alloc::string::String,
}
impl ::prost::Name for QueryRecAfterClickReq {
const NAME: &'static str = "QueryRecAfterClickReq";
const PACKAGE: &'static str = "bilibili.app.search.v2";
fn full_name() -> ::prost::alloc::string::String {
"bilibili.app.search.v2.QueryRecAfterClickReq".into()
}
fn type_url() -> ::prost::alloc::string::String {
"/bilibili.app.search.v2.QueryRecAfterClickReq".into()
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct QueryRecAfterClickResult {
#[prost(message, repeated, tag = "1")]
pub query_rec_list: ::prost::alloc::vec::Vec<QueryRecAfterClickItem>,
#[prost(string, tag = "2")]
pub related_title: ::prost::alloc::string::String,
#[prost(string, tag = "3")]
pub param: ::prost::alloc::string::String,
#[prost(string, tag = "4")]
pub goto: ::prost::alloc::string::String,
#[prost(string, tag = "5")]
pub linktype: ::prost::alloc::string::String,
#[prost(int32, tag = "6")]
pub position: i32,
#[prost(string, tag = "7")]
pub trackid: ::prost::alloc::string::String,
#[prost(string, tag = "8")]
pub user_act: ::prost::alloc::string::String,
}
impl ::prost::Name for QueryRecAfterClickResult {
const NAME: &'static str = "QueryRecAfterClickResult";
const PACKAGE: &'static str = "bilibili.app.search.v2";
fn full_name() -> ::prost::alloc::string::String {
"bilibili.app.search.v2.QueryRecAfterClickResult".into()
}
fn type_url() -> ::prost::alloc::string::String {
"/bilibili.app.search.v2.QueryRecAfterClickResult".into()
}
}
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct SearchDelFollowRequest {
#[prost(int64, tag = "1")]
pub cid: i64,
#[prost(enumeration = "FollowTypeEnum", tag = "2")]
pub follow_type: i32,
}
impl ::prost::Name for SearchDelFollowRequest {
const NAME: &'static str = "SearchDelFollowRequest";
const PACKAGE: &'static str = "bilibili.app.search.v2";
fn full_name() -> ::prost::alloc::string::String {
"bilibili.app.search.v2.SearchDelFollowRequest".into()
}
fn type_url() -> ::prost::alloc::string::String {
"/bilibili.app.search.v2.SearchDelFollowRequest".into()
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SearchDelFollowResponse {
#[prost(string, tag = "1")]
pub toast: ::prost::alloc::string::String,
}
impl ::prost::Name for SearchDelFollowResponse {
const NAME: &'static str = "SearchDelFollowResponse";
const PACKAGE: &'static str = "bilibili.app.search.v2";
fn full_name() -> ::prost::alloc::string::String {
"bilibili.app.search.v2.SearchDelFollowResponse".into()
}
fn type_url() -> ::prost::alloc::string::String {
"/bilibili.app.search.v2.SearchDelFollowResponse".into()
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SearchEggInfo {
#[prost(int32, tag = "1")]
pub egg_type: i32,
#[prost(int64, tag = "2")]
pub id: i64,
#[prost(int32, tag = "3")]
pub is_commercial: i32,
#[prost(string, tag = "4")]
pub mask_color: ::prost::alloc::string::String,
#[prost(int64, tag = "5")]
pub mask_transparency: i64,
#[prost(string, tag = "6")]
pub md5: ::prost::alloc::string::String,
#[prost(int32, tag = "7")]
pub re_type: i32,
#[prost(string, tag = "8")]
pub re_url: ::prost::alloc::string::String,
#[prost(string, tag = "9")]
pub re_value: ::prost::alloc::string::String,
#[prost(int32, tag = "10")]
pub show_count: i32,
#[prost(int64, tag = "11")]
pub size: i64,
#[prost(int64, tag = "12")]
pub source: i64,
#[prost(string, tag = "13")]
pub url: ::prost::alloc::string::String,
}
impl ::prost::Name for SearchEggInfo {
const NAME: &'static str = "SearchEggInfo";
const PACKAGE: &'static str = "bilibili.app.search.v2";
fn full_name() -> ::prost::alloc::string::String {
"bilibili.app.search.v2.SearchEggInfo".into()
}
fn type_url() -> ::prost::alloc::string::String {
"/bilibili.app.search.v2.SearchEggInfo".into()
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SearchEggInfos {
#[prost(message, repeated, tag = "1")]
pub egg_info: ::prost::alloc::vec::Vec<SearchEggInfo>,
}
impl ::prost::Name for SearchEggInfos {
const NAME: &'static str = "SearchEggInfos";
const PACKAGE: &'static str = "bilibili.app.search.v2";
fn full_name() -> ::prost::alloc::string::String {
"bilibili.app.search.v2.SearchEggInfos".into()
}
fn type_url() -> ::prost::alloc::string::String {
"/bilibili.app.search.v2.SearchEggInfos".into()
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SearchEggReply {
#[prost(int32, tag = "1")]
pub code: i32,
#[prost(string, tag = "2")]
pub seid: ::prost::alloc::string::String,
#[prost(message, optional, tag = "3")]
pub result: ::core::option::Option<SearchEggInfos>,
}
impl ::prost::Name for SearchEggReply {
const NAME: &'static str = "SearchEggReply";
const PACKAGE: &'static str = "bilibili.app.search.v2";
fn full_name() -> ::prost::alloc::string::String {
"bilibili.app.search.v2.SearchEggReply".into()
}
fn type_url() -> ::prost::alloc::string::String {
"/bilibili.app.search.v2.SearchEggReply".into()
}
}
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct SearchEggReq {}
impl ::prost::Name for SearchEggReq {
const NAME: &'static str = "SearchEggReq";
const PACKAGE: &'static str = "bilibili.app.search.v2";
fn full_name() -> ::prost::alloc::string::String {
"bilibili.app.search.v2.SearchEggReq".into()
}
fn type_url() -> ::prost::alloc::string::String {
"/bilibili.app.search.v2.SearchEggReq".into()
}
}
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct SearchFollowRequest {
#[prost(int64, tag = "1")]
pub cid: i64,
#[prost(enumeration = "FollowTypeEnum", tag = "2")]
pub follow_type: i32,
}
impl ::prost::Name for SearchFollowRequest {
const NAME: &'static str = "SearchFollowRequest";
const PACKAGE: &'static str = "bilibili.app.search.v2";
fn full_name() -> ::prost::alloc::string::String {
"bilibili.app.search.v2.SearchFollowRequest".into()
}
fn type_url() -> ::prost::alloc::string::String {
"/bilibili.app.search.v2.SearchFollowRequest".into()
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SearchFollowResponse {
#[prost(string, tag = "1")]
pub toast: ::prost::alloc::string::String,
}
impl ::prost::Name for SearchFollowResponse {
const NAME: &'static str = "SearchFollowResponse";
const PACKAGE: &'static str = "bilibili.app.search.v2";
fn full_name() -> ::prost::alloc::string::String {
"bilibili.app.search.v2.SearchFollowResponse".into()
}
fn type_url() -> ::prost::alloc::string::String {
"/bilibili.app.search.v2.SearchFollowResponse".into()
}
}
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct SearchLikeReply {
#[prost(int64, tag = "1")]
pub like_number: i64,
#[prost(int64, tag = "2")]
pub dislike_number: i64,
}
impl ::prost::Name for SearchLikeReply {
const NAME: &'static str = "SearchLikeReply";
const PACKAGE: &'static str = "bilibili.app.search.v2";
fn full_name() -> ::prost::alloc::string::String {
"bilibili.app.search.v2.SearchLikeReply".into()
}
fn type_url() -> ::prost::alloc::string::String {
"/bilibili.app.search.v2.SearchLikeReply".into()
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SearchLikeReq {
#[prost(string, tag = "1")]
pub business: ::prost::alloc::string::String,
#[prost(int64, tag = "2")]
pub message_id: i64,
#[prost(enumeration = "Action", tag = "3")]
pub action: i32,
}
impl ::prost::Name for SearchLikeReq {
const NAME: &'static str = "SearchLikeReq";
const PACKAGE: &'static str = "bilibili.app.search.v2";
fn full_name() -> ::prost::alloc::string::String {
"bilibili.app.search.v2.SearchLikeReq".into()
}
fn type_url() -> ::prost::alloc::string::String {
"/bilibili.app.search.v2.SearchLikeReq".into()
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SearchShortUrlReply {
#[prost(string, tag = "1")]
pub origin_url: ::prost::alloc::string::String,
}
impl ::prost::Name for SearchShortUrlReply {
const NAME: &'static str = "SearchShortUrlReply";
const PACKAGE: &'static str = "bilibili.app.search.v2";
fn full_name() -> ::prost::alloc::string::String {
"bilibili.app.search.v2.SearchShortUrlReply".into()
}
fn type_url() -> ::prost::alloc::string::String {
"/bilibili.app.search.v2.SearchShortUrlReply".into()
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SearchShortUrlReq {
#[prost(string, tag = "1")]
pub short_url: ::prost::alloc::string::String,
}
impl ::prost::Name for SearchShortUrlReq {
const NAME: &'static str = "SearchShortUrlReq";
const PACKAGE: &'static str = "bilibili.app.search.v2";
fn full_name() -> ::prost::alloc::string::String {
"bilibili.app.search.v2.SearchShortUrlReq".into()
}
fn type_url() -> ::prost::alloc::string::String {
"/bilibili.app.search.v2.SearchShortUrlReq".into()
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SubmitChatTaskReply {
#[prost(int32, tag = "1")]
pub code: i32,
#[prost(string, tag = "2")]
pub session_id: ::prost::alloc::string::String,
}
impl ::prost::Name for SubmitChatTaskReply {
const NAME: &'static str = "SubmitChatTaskReply";
const PACKAGE: &'static str = "bilibili.app.search.v2";
fn full_name() -> ::prost::alloc::string::String {
"bilibili.app.search.v2.SubmitChatTaskReply".into()
}
fn type_url() -> ::prost::alloc::string::String {
"/bilibili.app.search.v2.SubmitChatTaskReply".into()
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SubmitChatTaskReq {
#[prost(string, tag = "1")]
pub query: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub track_id: ::prost::alloc::string::String,
#[prost(string, tag = "3")]
pub from_source: ::prost::alloc::string::String,
}
impl ::prost::Name for SubmitChatTaskReq {
const NAME: &'static str = "SubmitChatTaskReq";
const PACKAGE: &'static str = "bilibili.app.search.v2";
fn full_name() -> ::prost::alloc::string::String {
"bilibili.app.search.v2.SubmitChatTaskReq".into()
}
fn type_url() -> ::prost::alloc::string::String {
"/bilibili.app.search.v2.SubmitChatTaskReq".into()
}
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum Action {
Unspecified = 0,
Like = 1,
CancelLike = 2,
Dislike = 3,
CancelDislike = 4,
}
impl Action {
pub fn as_str_name(&self) -> &'static str {
match self {
Self::Unspecified => "ACTION_UNSPECIFIED",
Self::Like => "ACTION_LIKE",
Self::CancelLike => "ACTION_CANCEL_LIKE",
Self::Dislike => "ACTION_DISLIKE",
Self::CancelDislike => "ACTION_CANCEL_DISLIKE",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"ACTION_UNSPECIFIED" => Some(Self::Unspecified),
"ACTION_LIKE" => Some(Self::Like),
"ACTION_CANCEL_LIKE" => Some(Self::CancelLike),
"ACTION_DISLIKE" => Some(Self::Dislike),
"ACTION_CANCEL_DISLIKE" => Some(Self::CancelDislike),
_ => None,
}
}
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum FollowTypeEnum {
Unknown = 0,
Comic = 1,
}
impl FollowTypeEnum {
pub fn as_str_name(&self) -> &'static str {
match self {
Self::Unknown => "UNKNOWN",
Self::Comic => "COMIC",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"UNKNOWN" => Some(Self::Unknown),
"COMIC" => Some(Self::Comic),
_ => None,
}
}
}
#[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 cancel_chat_task(
&mut self,
request: impl tonic::IntoRequest<super::CancelChatTaskReq>,
) -> std::result::Result<
tonic::Response<super::CancelChatTaskReply>,
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.app.search.v2.Search/CancelChatTask",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new("bilibili.app.search.v2.Search", "CancelChatTask"),
);
self.inner.unary(req, path, codec).await
}
pub async fn get_chat_auth(
&mut self,
request: impl tonic::IntoRequest<super::GetChatAuthReq>,
) -> std::result::Result<
tonic::Response<super::GetChatAuthReply>,
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.app.search.v2.Search/GetChatAuth",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("bilibili.app.search.v2.Search", "GetChatAuth"));
self.inner.unary(req, path, codec).await
}
pub async fn get_chat_result(
&mut self,
request: impl tonic::IntoRequest<super::GetChatResultReq>,
) -> std::result::Result<
tonic::Response<
super::super::super::super::broadcast::message::main::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.app.search.v2.Search/GetChatResult",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new("bilibili.app.search.v2.Search", "GetChatResult"),
);
self.inner.unary(req, path, codec).await
}
pub async fn query_rec_comment(
&mut self,
request: impl tonic::IntoRequest<super::QueryRecAfterClickReq>,
) -> std::result::Result<
tonic::Response<super::QueryRecAfterClickReply>,
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.app.search.v2.Search/QueryRecComment",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new("bilibili.app.search.v2.Search", "QueryRecComment"),
);
self.inner.unary(req, path, codec).await
}
pub async fn search_del_follow(
&mut self,
request: impl tonic::IntoRequest<super::SearchDelFollowRequest>,
) -> std::result::Result<
tonic::Response<super::SearchDelFollowResponse>,
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.app.search.v2.Search/SearchDelFollow",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new("bilibili.app.search.v2.Search", "SearchDelFollow"),
);
self.inner.unary(req, path, codec).await
}
pub async fn search_egg(
&mut self,
request: impl tonic::IntoRequest<super::SearchEggReq>,
) -> std::result::Result<tonic::Response<super::SearchEggReply>, 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.app.search.v2.Search/SearchEgg",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("bilibili.app.search.v2.Search", "SearchEgg"));
self.inner.unary(req, path, codec).await
}
pub async fn search_follow(
&mut self,
request: impl tonic::IntoRequest<super::SearchFollowRequest>,
) -> std::result::Result<
tonic::Response<super::SearchFollowResponse>,
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.app.search.v2.Search/SearchFollow",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new("bilibili.app.search.v2.Search", "SearchFollow"),
);
self.inner.unary(req, path, codec).await
}
pub async fn search_like(
&mut self,
request: impl tonic::IntoRequest<super::SearchLikeReq>,
) -> std::result::Result<
tonic::Response<super::SearchLikeReply>,
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.app.search.v2.Search/SearchLike",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("bilibili.app.search.v2.Search", "SearchLike"));
self.inner.unary(req, path, codec).await
}
pub async fn search_short_url(
&mut self,
request: impl tonic::IntoRequest<super::SearchShortUrlReq>,
) -> std::result::Result<
tonic::Response<super::SearchShortUrlReply>,
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.app.search.v2.Search/SearchShortUrl",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new("bilibili.app.search.v2.Search", "SearchShortUrl"),
);
self.inner.unary(req, path, codec).await
}
pub async fn submit_chat_task(
&mut self,
request: impl tonic::IntoRequest<super::SubmitChatTaskReq>,
) -> std::result::Result<
tonic::Response<super::SubmitChatTaskReply>,
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.app.search.v2.Search/SubmitChatTask",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new("bilibili.app.search.v2.Search", "SubmitChatTask"),
);
self.inner.unary(req, path, codec).await
}
}
}
#[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 {
async fn cancel_chat_task(
&self,
request: tonic::Request<super::CancelChatTaskReq>,
) -> std::result::Result<
tonic::Response<super::CancelChatTaskReply>,
tonic::Status,
>;
async fn get_chat_auth(
&self,
request: tonic::Request<super::GetChatAuthReq>,
) -> std::result::Result<
tonic::Response<super::GetChatAuthReply>,
tonic::Status,
>;
async fn get_chat_result(
&self,
request: tonic::Request<super::GetChatResultReq>,
) -> std::result::Result<
tonic::Response<
super::super::super::super::broadcast::message::main::ChatResult,
>,
tonic::Status,
>;
async fn query_rec_comment(
&self,
request: tonic::Request<super::QueryRecAfterClickReq>,
) -> std::result::Result<
tonic::Response<super::QueryRecAfterClickReply>,
tonic::Status,
>;
async fn search_del_follow(
&self,
request: tonic::Request<super::SearchDelFollowRequest>,
) -> std::result::Result<
tonic::Response<super::SearchDelFollowResponse>,
tonic::Status,
>;
async fn search_egg(
&self,
request: tonic::Request<super::SearchEggReq>,
) -> std::result::Result<tonic::Response<super::SearchEggReply>, tonic::Status>;
async fn search_follow(
&self,
request: tonic::Request<super::SearchFollowRequest>,
) -> std::result::Result<
tonic::Response<super::SearchFollowResponse>,
tonic::Status,
>;
async fn search_like(
&self,
request: tonic::Request<super::SearchLikeReq>,
) -> std::result::Result<tonic::Response<super::SearchLikeReply>, tonic::Status>;
async fn search_short_url(
&self,
request: tonic::Request<super::SearchShortUrlReq>,
) -> std::result::Result<
tonic::Response<super::SearchShortUrlReply>,
tonic::Status,
>;
async fn submit_chat_task(
&self,
request: tonic::Request<super::SubmitChatTaskReq>,
) -> std::result::Result<
tonic::Response<super::SubmitChatTaskReply>,
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.app.search.v2.Search/CancelChatTask" => {
#[allow(non_camel_case_types)]
struct CancelChatTaskSvc<T: Search>(pub Arc<T>);
impl<T: Search> tonic::server::UnaryService<super::CancelChatTaskReq>
for CancelChatTaskSvc<T> {
type Response = super::CancelChatTaskReply;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::CancelChatTaskReq>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as Search>::cancel_chat_task(&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 = CancelChatTaskSvc(inner);
let codec = tonic::codec::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
)
.apply_max_message_size_config(
max_decoding_message_size,
max_encoding_message_size,
);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/bilibili.app.search.v2.Search/GetChatAuth" => {
#[allow(non_camel_case_types)]
struct GetChatAuthSvc<T: Search>(pub Arc<T>);
impl<T: Search> tonic::server::UnaryService<super::GetChatAuthReq>
for GetChatAuthSvc<T> {
type Response = super::GetChatAuthReply;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::GetChatAuthReq>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as Search>::get_chat_auth(&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 = GetChatAuthSvc(inner);
let codec = tonic::codec::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
)
.apply_max_message_size_config(
max_decoding_message_size,
max_encoding_message_size,
);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/bilibili.app.search.v2.Search/GetChatResult" => {
#[allow(non_camel_case_types)]
struct GetChatResultSvc<T: Search>(pub Arc<T>);
impl<T: Search> tonic::server::UnaryService<super::GetChatResultReq>
for GetChatResultSvc<T> {
type Response = super::super::super::super::broadcast::message::main::ChatResult;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::GetChatResultReq>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as Search>::get_chat_result(&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 = GetChatResultSvc(inner);
let codec = tonic::codec::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
)
.apply_max_message_size_config(
max_decoding_message_size,
max_encoding_message_size,
);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/bilibili.app.search.v2.Search/QueryRecComment" => {
#[allow(non_camel_case_types)]
struct QueryRecCommentSvc<T: Search>(pub Arc<T>);
impl<
T: Search,
> tonic::server::UnaryService<super::QueryRecAfterClickReq>
for QueryRecCommentSvc<T> {
type Response = super::QueryRecAfterClickReply;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::QueryRecAfterClickReq>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as Search>::query_rec_comment(&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 = QueryRecCommentSvc(inner);
let codec = tonic::codec::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
)
.apply_max_message_size_config(
max_decoding_message_size,
max_encoding_message_size,
);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/bilibili.app.search.v2.Search/SearchDelFollow" => {
#[allow(non_camel_case_types)]
struct SearchDelFollowSvc<T: Search>(pub Arc<T>);
impl<
T: Search,
> tonic::server::UnaryService<super::SearchDelFollowRequest>
for SearchDelFollowSvc<T> {
type Response = super::SearchDelFollowResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::SearchDelFollowRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as Search>::search_del_follow(&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 = SearchDelFollowSvc(inner);
let codec = tonic::codec::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
)
.apply_max_message_size_config(
max_decoding_message_size,
max_encoding_message_size,
);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/bilibili.app.search.v2.Search/SearchEgg" => {
#[allow(non_camel_case_types)]
struct SearchEggSvc<T: Search>(pub Arc<T>);
impl<T: Search> tonic::server::UnaryService<super::SearchEggReq>
for SearchEggSvc<T> {
type Response = super::SearchEggReply;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::SearchEggReq>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as Search>::search_egg(&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 = SearchEggSvc(inner);
let codec = tonic::codec::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
)
.apply_max_message_size_config(
max_decoding_message_size,
max_encoding_message_size,
);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/bilibili.app.search.v2.Search/SearchFollow" => {
#[allow(non_camel_case_types)]
struct SearchFollowSvc<T: Search>(pub Arc<T>);
impl<
T: Search,
> tonic::server::UnaryService<super::SearchFollowRequest>
for SearchFollowSvc<T> {
type Response = super::SearchFollowResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::SearchFollowRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as Search>::search_follow(&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 = SearchFollowSvc(inner);
let codec = tonic::codec::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
)
.apply_max_message_size_config(
max_decoding_message_size,
max_encoding_message_size,
);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/bilibili.app.search.v2.Search/SearchLike" => {
#[allow(non_camel_case_types)]
struct SearchLikeSvc<T: Search>(pub Arc<T>);
impl<T: Search> tonic::server::UnaryService<super::SearchLikeReq>
for SearchLikeSvc<T> {
type Response = super::SearchLikeReply;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::SearchLikeReq>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as Search>::search_like(&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 = SearchLikeSvc(inner);
let codec = tonic::codec::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
)
.apply_max_message_size_config(
max_decoding_message_size,
max_encoding_message_size,
);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/bilibili.app.search.v2.Search/SearchShortUrl" => {
#[allow(non_camel_case_types)]
struct SearchShortUrlSvc<T: Search>(pub Arc<T>);
impl<T: Search> tonic::server::UnaryService<super::SearchShortUrlReq>
for SearchShortUrlSvc<T> {
type Response = super::SearchShortUrlReply;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::SearchShortUrlReq>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as Search>::search_short_url(&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 = SearchShortUrlSvc(inner);
let codec = tonic::codec::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
)
.apply_max_message_size_config(
max_decoding_message_size,
max_encoding_message_size,
);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/bilibili.app.search.v2.Search/SubmitChatTask" => {
#[allow(non_camel_case_types)]
struct SubmitChatTaskSvc<T: Search>(pub Arc<T>);
impl<T: Search> tonic::server::UnaryService<super::SubmitChatTaskReq>
for SubmitChatTaskSvc<T> {
type Response = super::SubmitChatTaskReply;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::SubmitChatTaskReq>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as Search>::submit_chat_task(&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 = SubmitChatTaskSvc(inner);
let codec = tonic::codec::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
)
.apply_max_message_size_config(
max_decoding_message_size,
max_encoding_message_size,
);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
_ => {
Box::pin(async move {
let mut response = http::Response::new(
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.app.search.v2.Search";
impl<T> tonic::server::NamedService for SearchServer<T> {
const NAME: &'static str = SERVICE_NAME;
}
}