#[derive(Clone, PartialEq, ::prost::Message)]
pub struct BottomTab {
#[prost(int64, tag = "1")]
pub id: i64,
#[prost(string, tag = "2")]
pub icon: ::prost::alloc::string::String,
#[prost(string, tag = "3")]
pub icon_day: ::prost::alloc::string::String,
#[prost(string, tag = "4")]
pub icon_night: ::prost::alloc::string::String,
#[prost(string, tag = "5")]
pub icon_selected: ::prost::alloc::string::String,
#[prost(string, tag = "6")]
pub name: ::prost::alloc::string::String,
#[prost(string, tag = "7")]
pub uri: ::prost::alloc::string::String,
#[prost(string, tag = "8")]
pub tab_id: ::prost::alloc::string::String,
#[prost(int64, tag = "9")]
pub default_selected: i64,
#[prost(int64, tag = "10")]
pub can_jump: i64,
#[prost(message, repeated, tag = "11")]
pub tab: ::prost::alloc::vec::Vec<Tab>,
#[prost(message, repeated, tag = "12")]
pub bubbles: ::prost::alloc::vec::Vec<Bubble>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Bubble {
#[prost(int64, tag = "1")]
pub id: i64,
#[prost(string, tag = "2")]
pub title: ::prost::alloc::string::String,
#[prost(string, tag = "3")]
pub cover: ::prost::alloc::string::String,
#[prost(int64, tag = "4")]
pub display_duration: i64,
#[prost(string, tag = "5")]
pub uri: ::prost::alloc::string::String,
#[prost(int64, tag = "6")]
pub uri_type: i64,
#[prost(int64, tag = "7")]
pub redisplay_interval: i64,
}
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct DmConf {
#[prost(int64, tag = "1")]
pub duration: i64,
#[prost(float, tag = "2")]
pub screen_occupancy: f32,
#[prost(float, tag = "3")]
pub scale: f32,
#[prost(float, tag = "4")]
pub transparency: f32,
#[prost(int64, tag = "5")]
pub dm_limit: i64,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DmView {
#[prost(bool, tag = "1")]
pub closed: bool,
#[prost(string, tag = "2")]
pub dm_placeholder: ::prost::alloc::string::String,
#[prost(string, tag = "3")]
pub dm_detail_placeholder: ::prost::alloc::string::String,
#[prost(message, optional, tag = "4")]
pub dm_conf: ::core::option::Option<DmConf>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct FavoriteListData {
#[prost(message, repeated, tag = "1")]
pub cards: ::prost::alloc::vec::Vec<FavoriteListDataCards>,
#[prost(bool, tag = "2")]
pub has_more: bool,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct FavoriteListDataCards {
#[prost(int64, tag = "1")]
pub rid: i64,
#[prost(string, tag = "2")]
pub title: ::prost::alloc::string::String,
#[prost(string, tag = "3")]
pub cover: ::prost::alloc::string::String,
#[prost(string, tag = "4")]
pub url: ::prost::alloc::string::String,
#[prost(string, tag = "5")]
pub desc: ::prost::alloc::string::String,
}
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct FavoriteListReq {
#[prost(int64, tag = "1")]
pub r#type: i64,
#[prost(int64, tag = "2")]
pub pn: i64,
#[prost(int64, tag = "3")]
pub ps: i64,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct FavoriteListResp {
#[prost(message, optional, tag = "1")]
pub data: ::core::option::Option<FavoriteListData>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct InStreamAdConfig {
#[prost(string, tag = "1")]
pub ad_unit_id: ::prost::alloc::string::String,
#[prost(message, optional, tag = "2")]
pub ad_tag_url_params: ::core::option::Option<in_stream_ad_config::AdTagUrlParams>,
}
pub mod in_stream_ad_config {
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct AdTagUrlParams {
#[prost(string, tag = "1")]
pub description_url: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub cust_params: ::prost::alloc::string::String,
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Jump {
#[prost(message, optional, tag = "1")]
pub op: ::core::option::Option<jump::Play>,
#[prost(message, optional, tag = "2")]
pub ed: ::core::option::Option<jump::Play>,
#[prost(bool, tag = "3")]
pub allow: bool,
#[prost(string, tag = "4")]
pub not_allow_toast: ::prost::alloc::string::String,
}
pub mod jump {
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct Play {
#[prost(int64, tag = "1")]
pub start_ms: i64,
#[prost(int64, tag = "2")]
pub end_ms: i64,
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct LiveRoomViewer {
#[prost(int64, tag = "1")]
pub mid: i64,
#[prost(string, tag = "2")]
pub avatar: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct OpenScreenAd {
#[prost(bool, tag = "1")]
pub show_ad: bool,
#[prost(bool, tag = "2")]
pub preload_recommend_ad: bool,
#[prost(string, tag = "3")]
pub recommend_ad_id: ::prost::alloc::string::String,
#[prost(string, tag = "4")]
pub open_screen_ad_id: ::prost::alloc::string::String,
#[prost(string, tag = "5")]
pub roll_ad_id: ::prost::alloc::string::String,
#[prost(string, tag = "6")]
pub feed_ad_id: ::prost::alloc::string::String,
#[prost(string, tag = "7")]
pub gaming_ad_id: ::prost::alloc::string::String,
#[prost(message, optional, tag = "8")]
pub open_screen: ::core::option::Option<OpenScreenAdConfig>,
#[prost(string, tag = "9")]
pub search_result_banner_ad_id: ::prost::alloc::string::String,
#[prost(string, tag = "10")]
pub gam_ad_id: ::prost::alloc::string::String,
#[prost(string, tag = "11")]
pub media_rectangle_ad_id: ::prost::alloc::string::String,
#[prost(string, tag = "12")]
pub download_rewarded_video_ad_id: ::prost::alloc::string::String,
#[prost(message, optional, tag = "13")]
pub pause_video_ad: ::core::option::Option<PauseVideoAdConfig>,
#[prost(message, optional, tag = "14")]
pub switch_video_interstitial_ad: ::core::option::Option<SwitchVideoInterstitialAd>,
#[prost(message, optional, tag = "15")]
pub in_stream_ad: ::core::option::Option<InStreamAdConfig>,
#[prost(string, tag = "16")]
pub download_page_banner_ad_id: ::prost::alloc::string::String,
#[prost(string, tag = "17")]
pub mine_banner_ad_id: ::prost::alloc::string::String,
#[prost(string, tag = "18")]
pub view_rewarded_video_ad_id: ::prost::alloc::string::String,
#[prost(message, repeated, tag = "99")]
pub tradplus_custom_maps: ::prost::alloc::vec::Vec<TradplusCustomMap>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct OpenScreenAdConfig {
#[prost(string, tag = "1")]
pub hot_ad_id: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub cold_ad_id: ::prost::alloc::string::String,
#[prost(int64, tag = "3")]
pub show_interval: i64,
#[prost(int64, tag = "4")]
pub load_time: i64,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct OpenScreenItem {
#[prost(int64, tag = "1")]
pub id: i64,
#[prost(int64, tag = "2")]
pub resource_id: i64,
#[prost(string, tag = "3")]
pub name: ::prost::alloc::string::String,
#[prost(string, tag = "4")]
pub cover: ::prost::alloc::string::String,
#[prost(string, tag = "5")]
pub link: ::prost::alloc::string::String,
#[prost(string, tag = "6")]
pub skip_text: ::prost::alloc::string::String,
#[prost(int64, tag = "7")]
pub show_duration: i64,
#[prost(int64, tag = "8")]
pub show_interval: i64,
#[prost(int64, tag = "9")]
pub on_time: i64,
#[prost(int64, tag = "10")]
pub off_time: i64,
#[prost(int64, tag = "11")]
pub material_type: i64,
#[prost(message, optional, tag = "12")]
pub video: ::core::option::Option<VideoMedia>,
#[prost(string, tag = "13")]
pub item_md5: ::prost::alloc::string::String,
#[prost(bool, tag = "98")]
pub enable_realtime_report: bool,
#[prost(string, tag = "99")]
pub realtime_report_payload: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct PauseVideoAdConfig {
#[prost(string, tag = "1")]
pub half_screen_ad_id: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub full_screen_ad_id: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct PlayControlReq {
#[prost(int64, tag = "1")]
pub aid: i64,
#[prost(int64, tag = "2")]
pub epid: i64,
#[prost(int64, tag = "3")]
pub sid: i64,
#[prost(string, tag = "4")]
pub subtitle_lang: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct PlayControlResp {
#[prost(string, tag = "1")]
pub subtitle_suggest_key: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub subtitle_feedback: ::prost::alloc::string::String,
#[prost(message, optional, tag = "3")]
pub jump: ::core::option::Option<Jump>,
#[prost(message, repeated, tag = "4")]
pub subtitles: ::prost::alloc::vec::Vec<Subtitle>,
#[prost(message, optional, tag = "5")]
pub watermark: ::core::option::Option<Watermark>,
#[prost(message, optional, tag = "6")]
pub dm_view: ::core::option::Option<DmView>,
#[prost(int64, tag = "7")]
pub progress: i64,
#[prost(message, optional, tag = "8")]
pub seek_bar: ::core::option::Option<SeekBar>,
}
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct PreloadOpenScreenReq {}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct PreloadOpenScreenResp {
#[prost(message, repeated, tag = "1")]
pub items: ::prost::alloc::vec::Vec<OpenScreenItem>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ResourceOpenScreenData {
#[prost(int64, tag = "1")]
pub id: i64,
#[prost(string, tag = "2")]
pub name: ::prost::alloc::string::String,
#[prost(string, tag = "3")]
pub cover: ::prost::alloc::string::String,
#[prost(string, tag = "4")]
pub link: ::prost::alloc::string::String,
#[prost(string, tag = "5")]
pub skip_text: ::prost::alloc::string::String,
#[prost(int64, tag = "6")]
pub show_duration: i64,
#[prost(int64, tag = "7")]
pub show_interval: i64,
#[prost(int64, tag = "8")]
pub off_time: i64,
#[prost(int64, tag = "9")]
pub on_time: i64,
#[prost(bool, tag = "10")]
pub show_ad: bool,
#[prost(message, optional, tag = "11")]
pub ad: ::core::option::Option<OpenScreenAd>,
#[prost(int64, tag = "12")]
pub material_type: i64,
#[prost(message, optional, tag = "13")]
pub video: ::core::option::Option<VideoMedia>,
#[prost(int64, tag = "14")]
pub open_screen_timeout: i64,
#[prost(int64, tag = "15")]
pub ad_show_interval: i64,
}
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct ResourceOpenScreenReq {}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ResourceOpenScreenResp {
#[prost(message, optional, tag = "1")]
pub data: ::core::option::Option<ResourceOpenScreenData>,
}
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct SearchDefaultWordsReq {}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SearchDefaultWordsResp {
#[prost(string, tag = "1")]
pub word: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub uri: ::prost::alloc::string::String,
#[prost(bool, tag = "3")]
pub can_search: bool,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SearchItem {
#[prost(string, tag = "1")]
pub title: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub title_color: ::prost::alloc::string::String,
#[prost(int64, tag = "3")]
pub season_id: i64,
#[prost(string, tag = "4")]
pub styles: ::prost::alloc::string::String,
#[prost(int64, tag = "5")]
pub mid: i64,
#[prost(string, tag = "6")]
pub author: ::prost::alloc::string::String,
#[prost(string, tag = "7")]
pub desc: ::prost::alloc::string::String,
#[prost(string, tag = "8")]
pub goto: ::prost::alloc::string::String,
#[prost(message, optional, tag = "9")]
pub statics: ::core::option::Option<search_item::SearchStatics>,
#[prost(string, tag = "10")]
pub duration: ::prost::alloc::string::String,
#[prost(string, tag = "11")]
pub uri: ::prost::alloc::string::String,
#[prost(int64, tag = "12")]
pub total: i64,
#[prost(int32, tag = "13")]
pub r#type: i32,
#[prost(string, tag = "14")]
pub cover: ::prost::alloc::string::String,
#[prost(string, tag = "15")]
pub param: ::prost::alloc::string::String,
#[prost(int64, tag = "16")]
pub pages: i64,
#[prost(string, tag = "17")]
pub name: ::prost::alloc::string::String,
#[prost(message, optional, tag = "18")]
pub watch_button: ::core::option::Option<search_item::WatchButton>,
#[prost(message, optional, tag = "19")]
pub follow_button: ::core::option::Option<search_item::FollowButton>,
#[prost(message, optional, tag = "20")]
pub up_follow_button: ::core::option::Option<search_item::UpFollowButton>,
#[prost(string, tag = "21")]
pub alias_search: ::prost::alloc::string::String,
#[prost(message, optional, tag = "22")]
pub identity: ::core::option::Option<search_item::Identity>,
#[prost(string, tag = "23")]
pub up_avatar: ::prost::alloc::string::String,
#[prost(string, tag = "24")]
pub copyright_info: ::prost::alloc::string::String,
#[prost(string, tag = "25")]
pub copyright_info_color: ::prost::alloc::string::String,
#[prost(int64, tag = "26")]
pub resource_id: i64,
#[prost(int64, tag = "27")]
pub task_id: i64,
#[prost(message, optional, tag = "28")]
pub card_corner_mark: ::core::option::Option<search_item::CornerMark>,
#[prost(message, optional, tag = "29")]
pub live: ::core::option::Option<SearchLiveRoom>,
}
pub mod search_item {
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CornerMark {
#[prost(string, tag = "1")]
pub bg_color: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub text: ::prost::alloc::string::String,
#[prost(string, tag = "3")]
pub left_icon: ::prost::alloc::string::String,
#[prost(string, tag = "4")]
pub image: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct FollowButton {
#[prost(string, tag = "1")]
pub icon: ::prost::alloc::string::String,
#[prost(map = "string, string", tag = "2")]
pub texts: ::std::collections::HashMap<
::prost::alloc::string::String,
::prost::alloc::string::String,
>,
#[prost(int32, tag = "3")]
pub follow_status: i32,
#[prost(string, tag = "4")]
pub status_report: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Identity {
#[prost(int64, tag = "1")]
pub role: i64,
#[prost(string, tag = "2")]
pub info: ::prost::alloc::string::String,
#[prost(string, tag = "3")]
pub icon: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SearchStatics {
#[prost(string, tag = "1")]
pub view: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct UpFollowButton {
#[prost(int32, tag = "1")]
pub status: i32,
#[prost(string, tag = "2")]
pub text: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct WatchButton {
#[prost(string, tag = "1")]
pub title: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub link: ::prost::alloc::string::String,
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SearchLiveRoom {
#[prost(int64, tag = "1")]
pub room_id: i64,
#[prost(enumeration = "LiveRoomType", tag = "2")]
pub r#type: i32,
#[prost(enumeration = "LiveRoomState", tag = "3")]
pub state: i32,
#[prost(string, tag = "4")]
pub uri: ::prost::alloc::string::String,
#[prost(string, tag = "5")]
pub online: ::prost::alloc::string::String,
#[prost(message, repeated, tag = "6")]
pub viewers: ::prost::alloc::vec::Vec<LiveRoomViewer>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SearchModule {
#[prost(string, tag = "1")]
pub module: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub title: ::prost::alloc::string::String,
#[prost(string, tag = "3")]
pub subtitle: ::prost::alloc::string::String,
#[prost(string, tag = "4")]
pub more_text: ::prost::alloc::string::String,
#[prost(string, tag = "5")]
pub bg_cover: ::prost::alloc::string::String,
#[prost(string, tag = "6")]
pub special_bg_color: ::prost::alloc::string::String,
#[prost(string, tag = "7")]
pub goto: ::prost::alloc::string::String,
#[prost(string, tag = "8")]
pub uri: ::prost::alloc::string::String,
#[prost(int64, tag = "9")]
pub page: i64,
#[prost(string, tag = "10")]
pub track_id: ::prost::alloc::string::String,
#[prost(message, repeated, tag = "11")]
pub items: ::prost::alloc::vec::Vec<SearchItem>,
#[prost(bool, tag = "12")]
pub has_more: bool,
#[prost(string, tag = "13")]
pub ad_scene_id: ::prost::alloc::string::String,
#[prost(message, optional, tag = "14")]
pub rect_banner_ad: ::core::option::Option<SearchResultRectBannerAd>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SearchReq {
#[prost(string, tag = "1")]
pub keyword: ::prost::alloc::string::String,
#[prost(int64, tag = "2")]
pub highlight: i64,
#[prost(string, tag = "3")]
pub qid: ::prost::alloc::string::String,
#[prost(int64, tag = "4")]
pub sort: i64,
#[prost(string, tag = "5")]
pub track_id: ::prost::alloc::string::String,
#[prost(int64, tag = "6")]
pub pn: i64,
#[prost(int64, tag = "7")]
pub ps: i64,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SearchResp {
#[prost(message, repeated, tag = "1")]
pub modules: ::prost::alloc::vec::Vec<SearchModule>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SearchResultRectBannerAd {
#[prost(string, tag = "1")]
pub ad_scene_id: ::prost::alloc::string::String,
#[prost(int64, tag = "2")]
pub count_down: i64,
#[prost(int64, tag = "3")]
pub max_show_count: i64,
#[prost(int64, tag = "4")]
pub min_play_interval: i64,
#[prost(string, tag = "5")]
pub close_tips: ::prost::alloc::string::String,
#[prost(bool, tag = "6")]
pub banner_ad_mutex_switch: bool,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SearchSquareAuthor {
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub face: ::prost::alloc::string::String,
#[prost(int64, tag = "3")]
pub mid: i64,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SearchSquareData {
#[prost(message, repeated, tag = "1")]
pub items: ::prost::alloc::vec::Vec<SearchSquareDataItem>,
#[prost(string, tag = "2")]
pub track_id: ::prost::alloc::string::String,
#[prost(string, tag = "3")]
pub r#type: ::prost::alloc::string::String,
#[prost(string, tag = "4")]
pub title: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SearchSquareDataItem {
#[prost(int64, tag = "1")]
pub season_id: i64,
#[prost(int64, tag = "2")]
pub rid: i64,
#[prost(int64, tag = "3")]
pub id: i64,
#[prost(string, tag = "4")]
pub title: ::prost::alloc::string::String,
#[prost(string, tag = "5")]
pub desc: ::prost::alloc::string::String,
#[prost(string, tag = "6")]
pub sub_desc: ::prost::alloc::string::String,
#[prost(string, tag = "7")]
pub uri: ::prost::alloc::string::String,
#[prost(string, tag = "8")]
pub image: ::prost::alloc::string::String,
#[prost(int32, tag = "9")]
pub style: i32,
#[prost(int32, tag = "10")]
pub trend: i32,
#[prost(int32, tag = "11")]
pub rank: i32,
#[prost(string, tag = "12")]
pub color: ::prost::alloc::string::String,
#[prost(bool, tag = "13")]
pub italic: bool,
#[prost(message, optional, tag = "14")]
pub author: ::core::option::Option<SearchSquareAuthor>,
#[prost(string, tag = "15")]
pub views: ::prost::alloc::string::String,
#[prost(bool, tag = "16")]
pub is_favorite: bool,
#[prost(message, optional, tag = "17")]
pub ogv_extra: ::core::option::Option<SearchSquareOgvExtra>,
#[prost(int64, tag = "18")]
pub resource_id: i64,
#[prost(int64, tag = "19")]
pub task_id: i64,
#[prost(int64, tag = "20")]
pub sid: i64,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SearchSquareOgvExtra {
#[prost(string, tag = "1")]
pub tag_text: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub tag_bg_color: ::prost::alloc::string::String,
#[prost(string, tag = "3")]
pub update_text: ::prost::alloc::string::String,
}
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct SearchSquareReq {}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SearchSquareResp {
#[prost(message, repeated, tag = "1")]
pub data: ::prost::alloc::vec::Vec<SearchSquareData>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SearchSuggestItem {
#[prost(string, tag = "1")]
pub keyword: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub r#type: ::prost::alloc::string::String,
#[prost(int64, tag = "3")]
pub item_id: i64,
#[prost(string, tag = "4")]
pub desc: ::prost::alloc::string::String,
#[prost(string, tag = "5")]
pub image: ::prost::alloc::string::String,
#[prost(string, tag = "6")]
pub uri: ::prost::alloc::string::String,
#[prost(string, tag = "7")]
pub goto: ::prost::alloc::string::String,
#[prost(double, tag = "8")]
pub score: f64,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SearchSuggestReq {
#[prost(string, tag = "1")]
pub keyword: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SearchSuggestResp {
#[prost(message, repeated, tag = "1")]
pub items: ::prost::alloc::vec::Vec<SearchSuggestItem>,
#[prost(string, tag = "2")]
pub track_id: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SearchTypeReq {
#[prost(string, tag = "1")]
pub keyword: ::prost::alloc::string::String,
#[prost(int64, tag = "2")]
pub highlight: i64,
#[prost(string, tag = "3")]
pub qid: ::prost::alloc::string::String,
#[prost(int64, tag = "4")]
pub sort: i64,
#[prost(string, tag = "5")]
pub track_id: ::prost::alloc::string::String,
#[prost(int32, tag = "6")]
pub r#type: i32,
#[prost(int64, tag = "7")]
pub pn: i64,
#[prost(int64, tag = "8")]
pub ps: i64,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SearchTypeResp {
#[prost(int64, tag = "1")]
pub pages: i64,
#[prost(int64, tag = "2")]
pub total: i64,
#[prost(message, repeated, tag = "3")]
pub items: ::prost::alloc::vec::Vec<SearchItem>,
#[prost(string, tag = "4")]
pub track_id: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SeekBar {
#[prost(int64, tag = "1")]
pub r#type: i64,
#[prost(string, tag = "2")]
pub icon: ::prost::alloc::string::String,
#[prost(string, tag = "3")]
pub lottie_squint: ::prost::alloc::string::String,
#[prost(string, tag = "4")]
pub lottie_blink: ::prost::alloc::string::String,
#[prost(string, tag = "5")]
pub seek_bar_color: ::prost::alloc::string::String,
}
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct ShowOpenScreenReq {
#[prost(int64, tag = "1")]
pub id: i64,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ShowOpenScreenResp {
#[prost(enumeration = "show_open_screen_resp::State", tag = "1")]
pub item_state: i32,
#[prost(message, optional, tag = "2")]
pub item: ::core::option::Option<OpenScreenItem>,
}
pub mod show_open_screen_resp {
#[derive(
Clone,
Copy,
Debug,
PartialEq,
Eq,
Hash,
PartialOrd,
Ord,
::prost::Enumeration
)]
#[repr(i32)]
pub enum State {
Unknown = 0,
Offline = 1,
Online = 2,
Scheduled = 3,
}
impl State {
pub fn as_str_name(&self) -> &'static str {
match self {
Self::Unknown => "STATE_UNKNOWN",
Self::Offline => "STATE_OFFLINE",
Self::Online => "STATE_ONLINE",
Self::Scheduled => "STATE_SCHEDULED",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"STATE_UNKNOWN" => Some(Self::Unknown),
"STATE_OFFLINE" => Some(Self::Offline),
"STATE_ONLINE" => Some(Self::Online),
"STATE_SCHEDULED" => Some(Self::Scheduled),
_ => None,
}
}
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Subtitle {
#[prost(int64, tag = "1")]
pub id: i64,
#[prost(string, tag = "2")]
pub key: ::prost::alloc::string::String,
#[prost(string, tag = "3")]
pub url: ::prost::alloc::string::String,
#[prost(string, tag = "4")]
pub title: ::prost::alloc::string::String,
#[prost(bool, tag = "5")]
pub is_machine: bool,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SwitchVideoInterstitialAd {
#[prost(string, tag = "1")]
pub ad_unit_id: ::prost::alloc::string::String,
#[prost(int64, tag = "2")]
pub ad_init_delay_time: i64,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Tab {
#[prost(int64, tag = "1")]
pub id: i64,
#[prost(string, tag = "2")]
pub icon_day: ::prost::alloc::string::String,
#[prost(string, tag = "3")]
pub icon_night: ::prost::alloc::string::String,
#[prost(string, tag = "4")]
pub name: ::prost::alloc::string::String,
#[prost(string, tag = "5")]
pub uri: ::prost::alloc::string::String,
#[prost(string, tag = "6")]
pub tab_id: ::prost::alloc::string::String,
#[prost(string, tag = "7")]
pub color: ::prost::alloc::string::String,
#[prost(int64, tag = "8")]
pub default_selected: i64,
#[prost(int64, tag = "9")]
pub start_time: i64,
#[prost(int64, tag = "10")]
pub end_time: i64,
#[prost(string, tag = "11")]
pub icon: ::prost::alloc::string::String,
#[prost(string, tag = "12")]
pub description: ::prost::alloc::string::String,
}
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct TabReq {}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct TabResp {
#[prost(message, repeated, tag = "1")]
pub bottom: ::prost::alloc::vec::Vec<BottomTab>,
#[prost(message, optional, tag = "2")]
pub config: ::core::option::Option<tab_resp::Config>,
}
pub mod tab_resp {
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Config {
#[prost(string, tag = "1")]
pub no_login_avatar: ::prost::alloc::string::String,
#[prost(int64, tag = "2")]
pub no_login_avatar_type: i64,
#[prost(int64, tag = "3")]
pub popup_style: i64,
#[prost(string, tag = "4")]
pub creator_upload: ::prost::alloc::string::String,
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Tag {
#[prost(string, tag = "1")]
pub title: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub uri: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct TradplusCustomMap {
#[prost(string, tag = "1")]
pub ad_id: ::prost::alloc::string::String,
#[prost(map = "string, string", tag = "2")]
pub custom_map: ::std::collections::HashMap<
::prost::alloc::string::String,
::prost::alloc::string::String,
>,
}
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct UserActionLogReq {}
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct UserActionLogResp {
#[prost(bool, tag = "1")]
pub has_download_action: bool,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct UserActionReq {
#[prost(enumeration = "UserActionType", tag = "1")]
pub action: i32,
#[prost(string, tag = "2")]
pub page_id: ::prost::alloc::string::String,
#[prost(string, tag = "3")]
pub country_code: ::prost::alloc::string::String,
#[prost(string, tag = "4")]
pub currency_code: ::prost::alloc::string::String,
#[prost(string, tag = "5")]
pub market: ::prost::alloc::string::String,
#[prost(int64, tag = "6")]
pub timestamp: i64,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct VideoMedia {
#[prost(string, tag = "1")]
pub play_url: ::prost::alloc::string::String,
#[prost(int64, tag = "2")]
pub width: i64,
#[prost(int64, tag = "3")]
pub height: i64,
}
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct VideoShotReq {
#[prost(int64, tag = "1")]
pub aid: i64,
#[prost(int64, tag = "2")]
pub epid: i64,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct VideoShotResp {
#[prost(string, tag = "1")]
pub pv_data: ::prost::alloc::string::String,
#[prost(int64, tag = "2")]
pub x_len: i64,
#[prost(int64, tag = "3")]
pub y_len: i64,
#[prost(int64, tag = "4")]
pub x_size: i64,
#[prost(int64, tag = "5")]
pub y_size: i64,
#[prost(string, repeated, tag = "6")]
pub images: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ViewCommandDm {
#[prost(int64, tag = "1")]
pub id: i64,
#[prost(string, tag = "2")]
pub command: ::prost::alloc::string::String,
#[prost(int64, tag = "3")]
pub progress: i64,
#[prost(string, tag = "4")]
pub extra: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ViewProgressData {
#[prost(message, repeated, tag = "1")]
pub command_dms: ::prost::alloc::vec::Vec<ViewCommandDm>,
}
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct ViewProgressReq {
#[prost(int64, tag = "1")]
pub oid: i64,
#[prost(enumeration = "OidType", tag = "2")]
pub o_type: i32,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ViewProgressResp {
#[prost(message, optional, tag = "1")]
pub data: ::core::option::Option<ViewProgressData>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Watermark {
#[prost(string, tag = "1")]
pub image: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub text: ::prost::alloc::string::String,
#[prost(int64, tag = "3")]
pub width: i64,
#[prost(int64, tag = "4")]
pub height: i64,
#[prost(double, tag = "5")]
pub half_proportion: f64,
#[prost(double, tag = "6")]
pub full_proportion: f64,
#[prost(string, tag = "7")]
pub text_color: ::prost::alloc::string::String,
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum LiveRoomState {
Unknown = 0,
Open = 1,
}
impl LiveRoomState {
pub fn as_str_name(&self) -> &'static str {
match self {
Self::Unknown => "LIVE_ROOM_STATE_UNKNOWN",
Self::Open => "LIVE_ROOM_STATE_OPEN",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"LIVE_ROOM_STATE_UNKNOWN" => Some(Self::Unknown),
"LIVE_ROOM_STATE_OPEN" => Some(Self::Open),
_ => None,
}
}
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum LiveRoomType {
Unknown = 0,
Live = 1,
Audio = 2,
}
impl LiveRoomType {
pub fn as_str_name(&self) -> &'static str {
match self {
Self::Unknown => "LIVE_ROOM_TYPE_UNKNOWN",
Self::Live => "LIVE_ROOM_TYPE_LIVE",
Self::Audio => "LIVE_ROOM_TYPE_AUDIO",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"LIVE_ROOM_TYPE_UNKNOWN" => Some(Self::Unknown),
"LIVE_ROOM_TYPE_LIVE" => Some(Self::Live),
"LIVE_ROOM_TYPE_AUDIO" => Some(Self::Audio),
_ => None,
}
}
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum OidType {
Unknown = 0,
Ugc = 1,
Ogv = 2,
}
impl OidType {
pub fn as_str_name(&self) -> &'static str {
match self {
Self::Unknown => "OidTypeUnknown",
Self::Ugc => "OidTypeUGC",
Self::Ogv => "OidTypeOGV",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"OidTypeUnknown" => Some(Self::Unknown),
"OidTypeUGC" => Some(Self::Ugc),
"OidTypeOGV" => Some(Self::Ogv),
_ => None,
}
}
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum UserActionType {
UserActionUnknown = 0,
UserActionPagePush = 1,
UserActionPagePop = 2,
CancelPremiumOrder = 3,
UserActionColdStart = 4,
}
impl UserActionType {
pub fn as_str_name(&self) -> &'static str {
match self {
Self::UserActionUnknown => "UserActionUnknown",
Self::UserActionPagePush => "UserActionPagePush",
Self::UserActionPagePop => "UserActionPagePop",
Self::CancelPremiumOrder => "CancelPremiumOrder",
Self::UserActionColdStart => "UserActionColdStart",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"UserActionUnknown" => Some(Self::UserActionUnknown),
"UserActionPagePush" => Some(Self::UserActionPagePush),
"UserActionPagePop" => Some(Self::UserActionPagePop),
"CancelPremiumOrder" => Some(Self::CancelPremiumOrder),
"UserActionColdStart" => Some(Self::UserActionColdStart),
_ => None,
}
}
}
pub mod app_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 AppClient<T> {
inner: tonic::client::Grpc<T>,
}
impl<T> AppClient<T>
where
T: tonic::client::GrpcService<tonic::body::BoxBody>,
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,
) -> AppClient<InterceptedService<T, F>>
where
F: tonic::service::Interceptor,
T::ResponseBody: Default,
T: tonic::codegen::Service<
http::Request<tonic::body::BoxBody>,
Response = http::Response<
<T as tonic::client::GrpcService<tonic::body::BoxBody>>::ResponseBody,
>,
>,
<T as tonic::codegen::Service<
http::Request<tonic::body::BoxBody>,
>>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
{
AppClient::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 favorite_list(
&mut self,
request: impl tonic::IntoRequest<super::FavoriteListReq>,
) -> std::result::Result<
tonic::Response<super::FavoriteListResp>,
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.intl.app.interfaces.v1.App/FavoriteList",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"bilibili.intl.app.interfaces.v1.App",
"FavoriteList",
),
);
self.inner.unary(req, path, codec).await
}
pub async fn ping(
&mut self,
request: impl tonic::IntoRequest<()>,
) -> std::result::Result<tonic::Response<()>, tonic::Status> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/bilibili.intl.app.interfaces.v1.App/Ping",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("bilibili.intl.app.interfaces.v1.App", "Ping"));
self.inner.unary(req, path, codec).await
}
pub async fn play_control(
&mut self,
request: impl tonic::IntoRequest<super::PlayControlReq>,
) -> std::result::Result<
tonic::Response<super::PlayControlResp>,
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.intl.app.interfaces.v1.App/PlayControl",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new("bilibili.intl.app.interfaces.v1.App", "PlayControl"),
);
self.inner.unary(req, path, codec).await
}
pub async fn preload_open_screen(
&mut self,
request: impl tonic::IntoRequest<super::PreloadOpenScreenReq>,
) -> std::result::Result<
tonic::Response<super::PreloadOpenScreenResp>,
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.intl.app.interfaces.v1.App/PreloadOpenScreen",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"bilibili.intl.app.interfaces.v1.App",
"PreloadOpenScreen",
),
);
self.inner.unary(req, path, codec).await
}
pub async fn resource_open_screen(
&mut self,
request: impl tonic::IntoRequest<super::ResourceOpenScreenReq>,
) -> std::result::Result<
tonic::Response<super::ResourceOpenScreenResp>,
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.intl.app.interfaces.v1.App/ResourceOpenScreen",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"bilibili.intl.app.interfaces.v1.App",
"ResourceOpenScreen",
),
);
self.inner.unary(req, path, codec).await
}
pub async fn search(
&mut self,
request: impl tonic::IntoRequest<super::SearchReq>,
) -> std::result::Result<tonic::Response<super::SearchResp>, 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.intl.app.interfaces.v1.App/Search",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new("bilibili.intl.app.interfaces.v1.App", "Search"),
);
self.inner.unary(req, path, codec).await
}
pub async fn search_default_words(
&mut self,
request: impl tonic::IntoRequest<super::SearchDefaultWordsReq>,
) -> std::result::Result<
tonic::Response<super::SearchDefaultWordsResp>,
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.intl.app.interfaces.v1.App/SearchDefaultWords",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"bilibili.intl.app.interfaces.v1.App",
"SearchDefaultWords",
),
);
self.inner.unary(req, path, codec).await
}
pub async fn search_square(
&mut self,
request: impl tonic::IntoRequest<super::SearchSquareReq>,
) -> std::result::Result<
tonic::Response<super::SearchSquareResp>,
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.intl.app.interfaces.v1.App/SearchSquare",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"bilibili.intl.app.interfaces.v1.App",
"SearchSquare",
),
);
self.inner.unary(req, path, codec).await
}
pub async fn search_suggest(
&mut self,
request: impl tonic::IntoRequest<super::SearchSuggestReq>,
) -> std::result::Result<
tonic::Response<super::SearchSuggestResp>,
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.intl.app.interfaces.v1.App/SearchSuggest",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"bilibili.intl.app.interfaces.v1.App",
"SearchSuggest",
),
);
self.inner.unary(req, path, codec).await
}
pub async fn search_type(
&mut self,
request: impl tonic::IntoRequest<super::SearchTypeReq>,
) -> std::result::Result<tonic::Response<super::SearchTypeResp>, 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.intl.app.interfaces.v1.App/SearchType",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new("bilibili.intl.app.interfaces.v1.App", "SearchType"),
);
self.inner.unary(req, path, codec).await
}
pub async fn show_open_screen(
&mut self,
request: impl tonic::IntoRequest<super::ShowOpenScreenReq>,
) -> std::result::Result<
tonic::Response<super::ShowOpenScreenResp>,
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.intl.app.interfaces.v1.App/ShowOpenScreen",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"bilibili.intl.app.interfaces.v1.App",
"ShowOpenScreen",
),
);
self.inner.unary(req, path, codec).await
}
pub async fn tab(
&mut self,
request: impl tonic::IntoRequest<super::TabReq>,
) -> std::result::Result<tonic::Response<super::TabResp>, 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.intl.app.interfaces.v1.App/Tab",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("bilibili.intl.app.interfaces.v1.App", "Tab"));
self.inner.unary(req, path, codec).await
}
pub async fn user_action(
&mut self,
request: impl tonic::IntoRequest<super::UserActionReq>,
) -> std::result::Result<tonic::Response<()>, tonic::Status> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/bilibili.intl.app.interfaces.v1.App/UserAction",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new("bilibili.intl.app.interfaces.v1.App", "UserAction"),
);
self.inner.unary(req, path, codec).await
}
pub async fn user_action_log(
&mut self,
request: impl tonic::IntoRequest<super::UserActionLogReq>,
) -> std::result::Result<
tonic::Response<super::UserActionLogResp>,
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.intl.app.interfaces.v1.App/UserActionLog",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"bilibili.intl.app.interfaces.v1.App",
"UserActionLog",
),
);
self.inner.unary(req, path, codec).await
}
pub async fn video_shot(
&mut self,
request: impl tonic::IntoRequest<super::VideoShotReq>,
) -> std::result::Result<tonic::Response<super::VideoShotResp>, 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.intl.app.interfaces.v1.App/VideoShot",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new("bilibili.intl.app.interfaces.v1.App", "VideoShot"),
);
self.inner.unary(req, path, codec).await
}
pub async fn view_progress(
&mut self,
request: impl tonic::IntoRequest<super::ViewProgressReq>,
) -> std::result::Result<
tonic::Response<super::ViewProgressResp>,
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.intl.app.interfaces.v1.App/ViewProgress",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"bilibili.intl.app.interfaces.v1.App",
"ViewProgress",
),
);
self.inner.unary(req, path, codec).await
}
}
}
pub mod app_server {
#![allow(
unused_variables,
dead_code,
missing_docs,
clippy::wildcard_imports,
clippy::let_unit_value,
)]
use tonic::codegen::*;
#[async_trait]
pub trait App: std::marker::Send + std::marker::Sync + 'static {
async fn favorite_list(
&self,
request: tonic::Request<super::FavoriteListReq>,
) -> std::result::Result<
tonic::Response<super::FavoriteListResp>,
tonic::Status,
>;
async fn ping(
&self,
request: tonic::Request<()>,
) -> std::result::Result<tonic::Response<()>, tonic::Status>;
async fn play_control(
&self,
request: tonic::Request<super::PlayControlReq>,
) -> std::result::Result<tonic::Response<super::PlayControlResp>, tonic::Status>;
async fn preload_open_screen(
&self,
request: tonic::Request<super::PreloadOpenScreenReq>,
) -> std::result::Result<
tonic::Response<super::PreloadOpenScreenResp>,
tonic::Status,
>;
async fn resource_open_screen(
&self,
request: tonic::Request<super::ResourceOpenScreenReq>,
) -> std::result::Result<
tonic::Response<super::ResourceOpenScreenResp>,
tonic::Status,
>;
async fn search(
&self,
request: tonic::Request<super::SearchReq>,
) -> std::result::Result<tonic::Response<super::SearchResp>, tonic::Status>;
async fn search_default_words(
&self,
request: tonic::Request<super::SearchDefaultWordsReq>,
) -> std::result::Result<
tonic::Response<super::SearchDefaultWordsResp>,
tonic::Status,
>;
async fn search_square(
&self,
request: tonic::Request<super::SearchSquareReq>,
) -> std::result::Result<
tonic::Response<super::SearchSquareResp>,
tonic::Status,
>;
async fn search_suggest(
&self,
request: tonic::Request<super::SearchSuggestReq>,
) -> std::result::Result<
tonic::Response<super::SearchSuggestResp>,
tonic::Status,
>;
async fn search_type(
&self,
request: tonic::Request<super::SearchTypeReq>,
) -> std::result::Result<tonic::Response<super::SearchTypeResp>, tonic::Status>;
async fn show_open_screen(
&self,
request: tonic::Request<super::ShowOpenScreenReq>,
) -> std::result::Result<
tonic::Response<super::ShowOpenScreenResp>,
tonic::Status,
>;
async fn tab(
&self,
request: tonic::Request<super::TabReq>,
) -> std::result::Result<tonic::Response<super::TabResp>, tonic::Status>;
async fn user_action(
&self,
request: tonic::Request<super::UserActionReq>,
) -> std::result::Result<tonic::Response<()>, tonic::Status>;
async fn user_action_log(
&self,
request: tonic::Request<super::UserActionLogReq>,
) -> std::result::Result<
tonic::Response<super::UserActionLogResp>,
tonic::Status,
>;
async fn video_shot(
&self,
request: tonic::Request<super::VideoShotReq>,
) -> std::result::Result<tonic::Response<super::VideoShotResp>, tonic::Status>;
async fn view_progress(
&self,
request: tonic::Request<super::ViewProgressReq>,
) -> std::result::Result<
tonic::Response<super::ViewProgressResp>,
tonic::Status,
>;
}
#[derive(Debug)]
pub struct AppServer<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> AppServer<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 AppServer<T>
where
T: App,
B: Body + std::marker::Send + 'static,
B::Error: Into<StdError> + std::marker::Send + 'static,
{
type Response = http::Response<tonic::body::BoxBody>;
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.intl.app.interfaces.v1.App/FavoriteList" => {
#[allow(non_camel_case_types)]
struct FavoriteListSvc<T: App>(pub Arc<T>);
impl<T: App> tonic::server::UnaryService<super::FavoriteListReq>
for FavoriteListSvc<T> {
type Response = super::FavoriteListResp;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::FavoriteListReq>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as App>::favorite_list(&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 = FavoriteListSvc(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.intl.app.interfaces.v1.App/Ping" => {
#[allow(non_camel_case_types)]
struct PingSvc<T: App>(pub Arc<T>);
impl<T: App> tonic::server::UnaryService<()> for PingSvc<T> {
type Response = ();
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(&mut self, request: tonic::Request<()>) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as App>::ping(&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 = PingSvc(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.intl.app.interfaces.v1.App/PlayControl" => {
#[allow(non_camel_case_types)]
struct PlayControlSvc<T: App>(pub Arc<T>);
impl<T: App> tonic::server::UnaryService<super::PlayControlReq>
for PlayControlSvc<T> {
type Response = super::PlayControlResp;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::PlayControlReq>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as App>::play_control(&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 = PlayControlSvc(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.intl.app.interfaces.v1.App/PreloadOpenScreen" => {
#[allow(non_camel_case_types)]
struct PreloadOpenScreenSvc<T: App>(pub Arc<T>);
impl<T: App> tonic::server::UnaryService<super::PreloadOpenScreenReq>
for PreloadOpenScreenSvc<T> {
type Response = super::PreloadOpenScreenResp;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::PreloadOpenScreenReq>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as App>::preload_open_screen(&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 = PreloadOpenScreenSvc(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.intl.app.interfaces.v1.App/ResourceOpenScreen" => {
#[allow(non_camel_case_types)]
struct ResourceOpenScreenSvc<T: App>(pub Arc<T>);
impl<
T: App,
> tonic::server::UnaryService<super::ResourceOpenScreenReq>
for ResourceOpenScreenSvc<T> {
type Response = super::ResourceOpenScreenResp;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::ResourceOpenScreenReq>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as App>::resource_open_screen(&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 = ResourceOpenScreenSvc(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.intl.app.interfaces.v1.App/Search" => {
#[allow(non_camel_case_types)]
struct SearchSvc<T: App>(pub Arc<T>);
impl<T: App> tonic::server::UnaryService<super::SearchReq>
for SearchSvc<T> {
type Response = super::SearchResp;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::SearchReq>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as App>::search(&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 = SearchSvc(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.intl.app.interfaces.v1.App/SearchDefaultWords" => {
#[allow(non_camel_case_types)]
struct SearchDefaultWordsSvc<T: App>(pub Arc<T>);
impl<
T: App,
> tonic::server::UnaryService<super::SearchDefaultWordsReq>
for SearchDefaultWordsSvc<T> {
type Response = super::SearchDefaultWordsResp;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::SearchDefaultWordsReq>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as App>::search_default_words(&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 = SearchDefaultWordsSvc(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.intl.app.interfaces.v1.App/SearchSquare" => {
#[allow(non_camel_case_types)]
struct SearchSquareSvc<T: App>(pub Arc<T>);
impl<T: App> tonic::server::UnaryService<super::SearchSquareReq>
for SearchSquareSvc<T> {
type Response = super::SearchSquareResp;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::SearchSquareReq>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as App>::search_square(&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 = SearchSquareSvc(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.intl.app.interfaces.v1.App/SearchSuggest" => {
#[allow(non_camel_case_types)]
struct SearchSuggestSvc<T: App>(pub Arc<T>);
impl<T: App> tonic::server::UnaryService<super::SearchSuggestReq>
for SearchSuggestSvc<T> {
type Response = super::SearchSuggestResp;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::SearchSuggestReq>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as App>::search_suggest(&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 = SearchSuggestSvc(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.intl.app.interfaces.v1.App/SearchType" => {
#[allow(non_camel_case_types)]
struct SearchTypeSvc<T: App>(pub Arc<T>);
impl<T: App> tonic::server::UnaryService<super::SearchTypeReq>
for SearchTypeSvc<T> {
type Response = super::SearchTypeResp;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::SearchTypeReq>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as App>::search_type(&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 = SearchTypeSvc(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.intl.app.interfaces.v1.App/ShowOpenScreen" => {
#[allow(non_camel_case_types)]
struct ShowOpenScreenSvc<T: App>(pub Arc<T>);
impl<T: App> tonic::server::UnaryService<super::ShowOpenScreenReq>
for ShowOpenScreenSvc<T> {
type Response = super::ShowOpenScreenResp;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::ShowOpenScreenReq>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as App>::show_open_screen(&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 = ShowOpenScreenSvc(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.intl.app.interfaces.v1.App/Tab" => {
#[allow(non_camel_case_types)]
struct TabSvc<T: App>(pub Arc<T>);
impl<T: App> tonic::server::UnaryService<super::TabReq>
for TabSvc<T> {
type Response = super::TabResp;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::TabReq>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as App>::tab(&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 = TabSvc(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.intl.app.interfaces.v1.App/UserAction" => {
#[allow(non_camel_case_types)]
struct UserActionSvc<T: App>(pub Arc<T>);
impl<T: App> tonic::server::UnaryService<super::UserActionReq>
for UserActionSvc<T> {
type Response = ();
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::UserActionReq>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as App>::user_action(&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 = UserActionSvc(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.intl.app.interfaces.v1.App/UserActionLog" => {
#[allow(non_camel_case_types)]
struct UserActionLogSvc<T: App>(pub Arc<T>);
impl<T: App> tonic::server::UnaryService<super::UserActionLogReq>
for UserActionLogSvc<T> {
type Response = super::UserActionLogResp;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::UserActionLogReq>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as App>::user_action_log(&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 = UserActionLogSvc(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.intl.app.interfaces.v1.App/VideoShot" => {
#[allow(non_camel_case_types)]
struct VideoShotSvc<T: App>(pub Arc<T>);
impl<T: App> tonic::server::UnaryService<super::VideoShotReq>
for VideoShotSvc<T> {
type Response = super::VideoShotResp;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::VideoShotReq>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as App>::video_shot(&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 = VideoShotSvc(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.intl.app.interfaces.v1.App/ViewProgress" => {
#[allow(non_camel_case_types)]
struct ViewProgressSvc<T: App>(pub Arc<T>);
impl<T: App> tonic::server::UnaryService<super::ViewProgressReq>
for ViewProgressSvc<T> {
type Response = super::ViewProgressResp;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::ViewProgressReq>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as App>::view_progress(&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 = ViewProgressSvc(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(empty_body());
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 AppServer<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.intl.app.interfaces.v1.App";
impl<T> tonic::server::NamedService for AppServer<T> {
const NAME: &'static str = SERVICE_NAME;
}
}