#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct AgreePolicyReply {}
impl ::prost::Name for AgreePolicyReply {
const NAME: &'static str = "AgreePolicyReply";
const PACKAGE: &'static str = "bilibili.pangu.gallery.v1";
fn full_name() -> ::prost::alloc::string::String {
"bilibili.pangu.gallery.v1.AgreePolicyReply".into()
}
fn type_url() -> ::prost::alloc::string::String {
"/bilibili.pangu.gallery.v1.AgreePolicyReply".into()
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct AgreePolicyReq {
#[prost(enumeration = "PolicyType", tag = "1")]
pub policy_type: i32,
#[prost(string, tag = "2")]
pub version: ::prost::alloc::string::String,
}
impl ::prost::Name for AgreePolicyReq {
const NAME: &'static str = "AgreePolicyReq";
const PACKAGE: &'static str = "bilibili.pangu.gallery.v1";
fn full_name() -> ::prost::alloc::string::String {
"bilibili.pangu.gallery.v1.AgreePolicyReq".into()
}
fn type_url() -> ::prost::alloc::string::String {
"/bilibili.pangu.gallery.v1.AgreePolicyReq".into()
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct BannerInfo {
#[prost(string, tag = "1")]
pub image_url: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub link: ::prost::alloc::string::String,
#[prost(string, tag = "3")]
pub title: ::prost::alloc::string::String,
}
impl ::prost::Name for BannerInfo {
const NAME: &'static str = "BannerInfo";
const PACKAGE: &'static str = "bilibili.pangu.gallery.v1";
fn full_name() -> ::prost::alloc::string::String {
"bilibili.pangu.gallery.v1.BannerInfo".into()
}
fn type_url() -> ::prost::alloc::string::String {
"/bilibili.pangu.gallery.v1.BannerInfo".into()
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct BasicInfoReply {
#[prost(string, tag = "1")]
pub customer_service_url: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub agreement_url: ::prost::alloc::string::String,
#[prost(string, tag = "3")]
pub privacy_url: ::prost::alloc::string::String,
#[prost(message, repeated, tag = "4")]
pub links: ::prost::alloc::vec::Vec<Link>,
}
impl ::prost::Name for BasicInfoReply {
const NAME: &'static str = "BasicInfoReply";
const PACKAGE: &'static str = "bilibili.pangu.gallery.v1";
fn full_name() -> ::prost::alloc::string::String {
"bilibili.pangu.gallery.v1.BasicInfoReply".into()
}
fn type_url() -> ::prost::alloc::string::String {
"/bilibili.pangu.gallery.v1.BasicInfoReply".into()
}
}
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct BasicInfoReq {
#[prost(int64, tag = "1")]
pub mid: i64,
}
impl ::prost::Name for BasicInfoReq {
const NAME: &'static str = "BasicInfoReq";
const PACKAGE: &'static str = "bilibili.pangu.gallery.v1";
fn full_name() -> ::prost::alloc::string::String {
"bilibili.pangu.gallery.v1.BasicInfoReq".into()
}
fn type_url() -> ::prost::alloc::string::String {
"/bilibili.pangu.gallery.v1.BasicInfoReq".into()
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Display {
#[prost(string, tag = "1")]
pub bg_theme_light: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub bg_theme_night: ::prost::alloc::string::String,
#[prost(string, tag = "3")]
pub nft_poster: ::prost::alloc::string::String,
#[prost(string, tag = "4")]
pub nft_raw: ::prost::alloc::string::String,
}
impl ::prost::Name for Display {
const NAME: &'static str = "Display";
const PACKAGE: &'static str = "bilibili.pangu.gallery.v1";
fn full_name() -> ::prost::alloc::string::String {
"bilibili.pangu.gallery.v1.Display".into()
}
fn type_url() -> ::prost::alloc::string::String {
"/bilibili.pangu.gallery.v1.Display".into()
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetBannersReply {
#[prost(message, repeated, tag = "1")]
pub banner_list: ::prost::alloc::vec::Vec<BannerInfo>,
}
impl ::prost::Name for GetBannersReply {
const NAME: &'static str = "GetBannersReply";
const PACKAGE: &'static str = "bilibili.pangu.gallery.v1";
fn full_name() -> ::prost::alloc::string::String {
"bilibili.pangu.gallery.v1.GetBannersReply".into()
}
fn type_url() -> ::prost::alloc::string::String {
"/bilibili.pangu.gallery.v1.GetBannersReply".into()
}
}
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct GetBannersReq {
#[prost(int64, tag = "1")]
pub uid: i64,
}
impl ::prost::Name for GetBannersReq {
const NAME: &'static str = "GetBannersReq";
const PACKAGE: &'static str = "bilibili.pangu.gallery.v1";
fn full_name() -> ::prost::alloc::string::String {
"bilibili.pangu.gallery.v1.GetBannersReq".into()
}
fn type_url() -> ::prost::alloc::string::String {
"/bilibili.pangu.gallery.v1.GetBannersReq".into()
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetLastPolicyReply {
#[prost(string, tag = "1")]
pub short_desc: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub detail_jump: ::prost::alloc::string::String,
#[prost(string, tag = "3")]
pub version: ::prost::alloc::string::String,
}
impl ::prost::Name for GetLastPolicyReply {
const NAME: &'static str = "GetLastPolicyReply";
const PACKAGE: &'static str = "bilibili.pangu.gallery.v1";
fn full_name() -> ::prost::alloc::string::String {
"bilibili.pangu.gallery.v1.GetLastPolicyReply".into()
}
fn type_url() -> ::prost::alloc::string::String {
"/bilibili.pangu.gallery.v1.GetLastPolicyReply".into()
}
}
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct GetLastPolicyReq {
#[prost(enumeration = "PolicyType", tag = "1")]
pub policy_type: i32,
}
impl ::prost::Name for GetLastPolicyReq {
const NAME: &'static str = "GetLastPolicyReq";
const PACKAGE: &'static str = "bilibili.pangu.gallery.v1";
fn full_name() -> ::prost::alloc::string::String {
"bilibili.pangu.gallery.v1.GetLastPolicyReq".into()
}
fn type_url() -> ::prost::alloc::string::String {
"/bilibili.pangu.gallery.v1.GetLastPolicyReq".into()
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetUserInfoReply {
#[prost(int64, tag = "1")]
pub mid: i64,
#[prost(string, tag = "2")]
pub name: ::prost::alloc::string::String,
#[prost(string, tag = "3")]
pub address: ::prost::alloc::string::String,
#[prost(string, tag = "4")]
pub avatar_url: ::prost::alloc::string::String,
#[prost(string, tag = "5")]
pub help_url: ::prost::alloc::string::String,
}
impl ::prost::Name for GetUserInfoReply {
const NAME: &'static str = "GetUserInfoReply";
const PACKAGE: &'static str = "bilibili.pangu.gallery.v1";
fn full_name() -> ::prost::alloc::string::String {
"bilibili.pangu.gallery.v1.GetUserInfoReply".into()
}
fn type_url() -> ::prost::alloc::string::String {
"/bilibili.pangu.gallery.v1.GetUserInfoReply".into()
}
}
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct GetUserInfoReq {
#[prost(int64, tag = "1")]
pub mid: i64,
}
impl ::prost::Name for GetUserInfoReq {
const NAME: &'static str = "GetUserInfoReq";
const PACKAGE: &'static str = "bilibili.pangu.gallery.v1";
fn full_name() -> ::prost::alloc::string::String {
"bilibili.pangu.gallery.v1.GetUserInfoReq".into()
}
fn type_url() -> ::prost::alloc::string::String {
"/bilibili.pangu.gallery.v1.GetUserInfoReq".into()
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Link {
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub link_url: ::prost::alloc::string::String,
#[prost(string, tag = "3")]
pub track_event_id: ::prost::alloc::string::String,
}
impl ::prost::Name for Link {
const NAME: &'static str = "Link";
const PACKAGE: &'static str = "bilibili.pangu.gallery.v1";
fn full_name() -> ::prost::alloc::string::String {
"bilibili.pangu.gallery.v1.Link".into()
}
fn type_url() -> ::prost::alloc::string::String {
"/bilibili.pangu.gallery.v1.Link".into()
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListNftByMidReply {
#[prost(message, repeated, tag = "1")]
pub nfts: ::prost::alloc::vec::Vec<Nft>,
#[prost(int64, tag = "2")]
pub anchor_id: i64,
#[prost(bool, tag = "3")]
pub end: bool,
}
impl ::prost::Name for ListNftByMidReply {
const NAME: &'static str = "ListNFTByMidReply";
const PACKAGE: &'static str = "bilibili.pangu.gallery.v1";
fn full_name() -> ::prost::alloc::string::String {
"bilibili.pangu.gallery.v1.ListNFTByMidReply".into()
}
fn type_url() -> ::prost::alloc::string::String {
"/bilibili.pangu.gallery.v1.ListNFTByMidReply".into()
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListNftByMidReq {
#[prost(int64, tag = "1")]
pub mid: i64,
#[prost(string, tag = "2")]
pub category: ::prost::alloc::string::String,
#[prost(string, tag = "3")]
pub biz_type: ::prost::alloc::string::String,
#[prost(int64, tag = "4")]
pub anchor_id: i64,
#[prost(int64, tag = "5")]
pub page_size: i64,
}
impl ::prost::Name for ListNftByMidReq {
const NAME: &'static str = "ListNFTByMidReq";
const PACKAGE: &'static str = "bilibili.pangu.gallery.v1";
fn full_name() -> ::prost::alloc::string::String {
"bilibili.pangu.gallery.v1.ListNFTByMidReq".into()
}
fn type_url() -> ::prost::alloc::string::String {
"/bilibili.pangu.gallery.v1.ListNFTByMidReq".into()
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListOrderByMidReply {
#[prost(message, repeated, tag = "1")]
pub orders: ::prost::alloc::vec::Vec<Order>,
#[prost(int64, tag = "2")]
pub anchor_id: i64,
#[prost(bool, tag = "3")]
pub end: bool,
}
impl ::prost::Name for ListOrderByMidReply {
const NAME: &'static str = "ListOrderByMidReply";
const PACKAGE: &'static str = "bilibili.pangu.gallery.v1";
fn full_name() -> ::prost::alloc::string::String {
"bilibili.pangu.gallery.v1.ListOrderByMidReply".into()
}
fn type_url() -> ::prost::alloc::string::String {
"/bilibili.pangu.gallery.v1.ListOrderByMidReply".into()
}
}
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct ListOrderByMidReq {
#[prost(int64, tag = "1")]
pub mid: i64,
#[prost(int64, tag = "2")]
pub anchor_id: i64,
#[prost(int64, tag = "3")]
pub page_size: i64,
#[prost(enumeration = "RecordType", tag = "4")]
pub rc_type: i32,
}
impl ::prost::Name for ListOrderByMidReq {
const NAME: &'static str = "ListOrderByMidReq";
const PACKAGE: &'static str = "bilibili.pangu.gallery.v1";
fn full_name() -> ::prost::alloc::string::String {
"bilibili.pangu.gallery.v1.ListOrderByMidReq".into()
}
fn type_url() -> ::prost::alloc::string::String {
"/bilibili.pangu.gallery.v1.ListOrderByMidReq".into()
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct MinePageReply {
#[prost(int64, tag = "1")]
pub uid: i64,
#[prost(string, tag = "2")]
pub name: ::prost::alloc::string::String,
#[prost(string, tag = "3")]
pub address: ::prost::alloc::string::String,
#[prost(string, tag = "4")]
pub avatar_url: ::prost::alloc::string::String,
#[prost(string, tag = "5")]
pub question_jump: ::prost::alloc::string::String,
#[prost(string, tag = "6")]
pub about_us_jump: ::prost::alloc::string::String,
}
impl ::prost::Name for MinePageReply {
const NAME: &'static str = "MinePageReply";
const PACKAGE: &'static str = "bilibili.pangu.gallery.v1";
fn full_name() -> ::prost::alloc::string::String {
"bilibili.pangu.gallery.v1.MinePageReply".into()
}
fn type_url() -> ::prost::alloc::string::String {
"/bilibili.pangu.gallery.v1.MinePageReply".into()
}
}
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct MinePageReq {
#[prost(int64, tag = "1")]
pub uid: i64,
}
impl ::prost::Name for MinePageReq {
const NAME: &'static str = "MinePageReq";
const PACKAGE: &'static str = "bilibili.pangu.gallery.v1";
fn full_name() -> ::prost::alloc::string::String {
"bilibili.pangu.gallery.v1.MinePageReq".into()
}
fn type_url() -> ::prost::alloc::string::String {
"/bilibili.pangu.gallery.v1.MinePageReq".into()
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Nft {
#[prost(string, tag = "1")]
pub nft_id: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub item_name: ::prost::alloc::string::String,
#[prost(string, tag = "3")]
pub serial_number: ::prost::alloc::string::String,
#[prost(string, tag = "4")]
pub issuer: ::prost::alloc::string::String,
#[prost(message, optional, tag = "5")]
pub display: ::core::option::Option<Display>,
#[prost(string, tag = "6")]
pub detail_url: ::prost::alloc::string::String,
#[prost(enumeration = "NftStatus", tag = "7")]
pub nft_status: i32,
#[prost(int64, tag = "8")]
pub item_id: i64,
}
impl ::prost::Name for Nft {
const NAME: &'static str = "NFT";
const PACKAGE: &'static str = "bilibili.pangu.gallery.v1";
fn full_name() -> ::prost::alloc::string::String {
"bilibili.pangu.gallery.v1.NFT".into()
}
fn type_url() -> ::prost::alloc::string::String {
"/bilibili.pangu.gallery.v1.NFT".into()
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Order {
#[prost(string, tag = "1")]
pub item_name: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub serial_number: ::prost::alloc::string::String,
#[prost(string, tag = "3")]
pub tx_hash: ::prost::alloc::string::String,
#[prost(string, tag = "4")]
pub tx_time: ::prost::alloc::string::String,
#[prost(string, tag = "5")]
pub issuer: ::prost::alloc::string::String,
#[prost(string, tag = "6")]
pub issue_time: ::prost::alloc::string::String,
#[prost(string, tag = "7")]
pub token_id: ::prost::alloc::string::String,
#[prost(message, optional, tag = "8")]
pub display: ::core::option::Option<Display>,
#[prost(string, tag = "9")]
pub contract_address: ::prost::alloc::string::String,
#[prost(string, tag = "10")]
pub hash_jump: ::prost::alloc::string::String,
#[prost(string, tag = "11")]
pub contract_jump: ::prost::alloc::string::String,
#[prost(bool, tag = "12")]
pub disable_browser_jump: bool,
}
impl ::prost::Name for Order {
const NAME: &'static str = "Order";
const PACKAGE: &'static str = "bilibili.pangu.gallery.v1";
fn full_name() -> ::prost::alloc::string::String {
"bilibili.pangu.gallery.v1.Order".into()
}
fn type_url() -> ::prost::alloc::string::String {
"/bilibili.pangu.gallery.v1.Order".into()
}
}
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct UserCheckReply {
#[prost(enumeration = "PolicyAgreeStatus", tag = "1")]
pub policy_status: i32,
#[prost(enumeration = "Gt14Status", tag = "2")]
pub gt14: i32,
}
impl ::prost::Name for UserCheckReply {
const NAME: &'static str = "UserCheckReply";
const PACKAGE: &'static str = "bilibili.pangu.gallery.v1";
fn full_name() -> ::prost::alloc::string::String {
"bilibili.pangu.gallery.v1.UserCheckReply".into()
}
fn type_url() -> ::prost::alloc::string::String {
"/bilibili.pangu.gallery.v1.UserCheckReply".into()
}
}
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct UserCheckReq {
#[prost(int64, tag = "1")]
pub mid: i64,
#[prost(enumeration = "PolicyType", tag = "2")]
pub policy_type: i32,
}
impl ::prost::Name for UserCheckReq {
const NAME: &'static str = "UserCheckReq";
const PACKAGE: &'static str = "bilibili.pangu.gallery.v1";
fn full_name() -> ::prost::alloc::string::String {
"bilibili.pangu.gallery.v1.UserCheckReq".into()
}
fn type_url() -> ::prost::alloc::string::String {
"/bilibili.pangu.gallery.v1.UserCheckReq".into()
}
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum Gt14Status {
Lt14 = 0,
Ge14 = 1,
UnknownGt14 = 2,
}
impl Gt14Status {
pub fn as_str_name(&self) -> &'static str {
match self {
Self::Lt14 => "LT14",
Self::Ge14 => "GE14",
Self::UnknownGt14 => "UNKNOWN_GT14",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"LT14" => Some(Self::Lt14),
"GE14" => Some(Self::Ge14),
"UNKNOWN_GT14" => Some(Self::UnknownGt14),
_ => None,
}
}
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum NftStatus {
Undefined = 0,
Normal = 1,
Doing = 2,
}
impl NftStatus {
pub fn as_str_name(&self) -> &'static str {
match self {
Self::Undefined => "UNDEFINED",
Self::Normal => "NORMAL",
Self::Doing => "DOING",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"UNDEFINED" => Some(Self::Undefined),
"NORMAL" => Some(Self::Normal),
"DOING" => Some(Self::Doing),
_ => None,
}
}
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum PolicyAgreeStatus {
Unsigned = 0,
Accepted = 1,
Expired = 2,
}
impl PolicyAgreeStatus {
pub fn as_str_name(&self) -> &'static str {
match self {
Self::Unsigned => "UNSIGNED",
Self::Accepted => "ACCEPTED",
Self::Expired => "EXPIRED",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"UNSIGNED" => Some(Self::Unsigned),
"ACCEPTED" => Some(Self::Accepted),
"EXPIRED" => Some(Self::Expired),
_ => None,
}
}
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum PolicyType {
UnknownPolicy = 0,
Wallet = 1,
Sale = 2,
}
impl PolicyType {
pub fn as_str_name(&self) -> &'static str {
match self {
Self::UnknownPolicy => "UNKNOWN_POLICY",
Self::Wallet => "WALLET",
Self::Sale => "SALE",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"UNKNOWN_POLICY" => Some(Self::UnknownPolicy),
"WALLET" => Some(Self::Wallet),
"SALE" => Some(Self::Sale),
_ => None,
}
}
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum RecordType {
All = 0,
Input = 1,
Output = 2,
}
impl RecordType {
pub fn as_str_name(&self) -> &'static str {
match self {
Self::All => "All",
Self::Input => "input",
Self::Output => "output",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"All" => Some(Self::All),
"input" => Some(Self::Input),
"output" => Some(Self::Output),
_ => None,
}
}
}
#[cfg(feature = "feat-enable-generated-client")]
pub mod gallery_interface_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 GalleryInterfaceClient<T> {
inner: tonic::client::Grpc<T>,
}
impl<T> GalleryInterfaceClient<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,
) -> GalleryInterfaceClient<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,
{
GalleryInterfaceClient::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 agree_policy(
&mut self,
request: impl tonic::IntoRequest<super::AgreePolicyReq>,
) -> std::result::Result<
tonic::Response<super::AgreePolicyReply>,
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.pangu.gallery.v1.GalleryInterface/AgreePolicy",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"bilibili.pangu.gallery.v1.GalleryInterface",
"AgreePolicy",
),
);
self.inner.unary(req, path, codec).await
}
pub async fn basic_info(
&mut self,
request: impl tonic::IntoRequest<super::BasicInfoReq>,
) -> std::result::Result<tonic::Response<super::BasicInfoReply>, 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.pangu.gallery.v1.GalleryInterface/BasicInfo",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"bilibili.pangu.gallery.v1.GalleryInterface",
"BasicInfo",
),
);
self.inner.unary(req, path, codec).await
}
pub async fn get_banners(
&mut self,
request: impl tonic::IntoRequest<super::GetBannersReq>,
) -> std::result::Result<
tonic::Response<super::GetBannersReply>,
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.pangu.gallery.v1.GalleryInterface/GetBanners",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"bilibili.pangu.gallery.v1.GalleryInterface",
"GetBanners",
),
);
self.inner.unary(req, path, codec).await
}
pub async fn get_last_policy(
&mut self,
request: impl tonic::IntoRequest<super::GetLastPolicyReq>,
) -> std::result::Result<
tonic::Response<super::GetLastPolicyReply>,
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.pangu.gallery.v1.GalleryInterface/GetLastPolicy",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"bilibili.pangu.gallery.v1.GalleryInterface",
"GetLastPolicy",
),
);
self.inner.unary(req, path, codec).await
}
pub async fn list_nft_by_mid(
&mut self,
request: impl tonic::IntoRequest<super::ListNftByMidReq>,
) -> std::result::Result<
tonic::Response<super::ListNftByMidReply>,
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.pangu.gallery.v1.GalleryInterface/ListNFTByMid",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"bilibili.pangu.gallery.v1.GalleryInterface",
"ListNFTByMid",
),
);
self.inner.unary(req, path, codec).await
}
pub async fn list_order_by_mid(
&mut self,
request: impl tonic::IntoRequest<super::ListOrderByMidReq>,
) -> std::result::Result<
tonic::Response<super::ListOrderByMidReply>,
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.pangu.gallery.v1.GalleryInterface/ListOrderByMid",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"bilibili.pangu.gallery.v1.GalleryInterface",
"ListOrderByMid",
),
);
self.inner.unary(req, path, codec).await
}
pub async fn mine_page(
&mut self,
request: impl tonic::IntoRequest<super::MinePageReq>,
) -> std::result::Result<tonic::Response<super::MinePageReply>, 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.pangu.gallery.v1.GalleryInterface/MinePage",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"bilibili.pangu.gallery.v1.GalleryInterface",
"MinePage",
),
);
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.pangu.gallery.v1.GalleryInterface/Ping",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new("bilibili.pangu.gallery.v1.GalleryInterface", "Ping"),
);
self.inner.unary(req, path, codec).await
}
pub async fn user_check(
&mut self,
request: impl tonic::IntoRequest<super::UserCheckReq>,
) -> std::result::Result<tonic::Response<super::UserCheckReply>, 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.pangu.gallery.v1.GalleryInterface/UserCheck",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"bilibili.pangu.gallery.v1.GalleryInterface",
"UserCheck",
),
);
self.inner.unary(req, path, codec).await
}
pub async fn user_info(
&mut self,
request: impl tonic::IntoRequest<super::GetUserInfoReq>,
) -> std::result::Result<
tonic::Response<super::GetUserInfoReply>,
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.pangu.gallery.v1.GalleryInterface/UserInfo",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"bilibili.pangu.gallery.v1.GalleryInterface",
"UserInfo",
),
);
self.inner.unary(req, path, codec).await
}
}
}
#[cfg(feature = "feat-enable-generated-server")]
pub mod gallery_interface_server {
#![allow(
unused_variables,
dead_code,
missing_docs,
clippy::wildcard_imports,
clippy::let_unit_value,
)]
use tonic::codegen::*;
#[async_trait]
pub trait GalleryInterface: std::marker::Send + std::marker::Sync + 'static {
async fn agree_policy(
&self,
request: tonic::Request<super::AgreePolicyReq>,
) -> std::result::Result<
tonic::Response<super::AgreePolicyReply>,
tonic::Status,
>;
async fn basic_info(
&self,
request: tonic::Request<super::BasicInfoReq>,
) -> std::result::Result<tonic::Response<super::BasicInfoReply>, tonic::Status>;
async fn get_banners(
&self,
request: tonic::Request<super::GetBannersReq>,
) -> std::result::Result<tonic::Response<super::GetBannersReply>, tonic::Status>;
async fn get_last_policy(
&self,
request: tonic::Request<super::GetLastPolicyReq>,
) -> std::result::Result<
tonic::Response<super::GetLastPolicyReply>,
tonic::Status,
>;
async fn list_nft_by_mid(
&self,
request: tonic::Request<super::ListNftByMidReq>,
) -> std::result::Result<
tonic::Response<super::ListNftByMidReply>,
tonic::Status,
>;
async fn list_order_by_mid(
&self,
request: tonic::Request<super::ListOrderByMidReq>,
) -> std::result::Result<
tonic::Response<super::ListOrderByMidReply>,
tonic::Status,
>;
async fn mine_page(
&self,
request: tonic::Request<super::MinePageReq>,
) -> std::result::Result<tonic::Response<super::MinePageReply>, tonic::Status>;
async fn ping(
&self,
request: tonic::Request<()>,
) -> std::result::Result<tonic::Response<()>, tonic::Status>;
async fn user_check(
&self,
request: tonic::Request<super::UserCheckReq>,
) -> std::result::Result<tonic::Response<super::UserCheckReply>, tonic::Status>;
async fn user_info(
&self,
request: tonic::Request<super::GetUserInfoReq>,
) -> std::result::Result<
tonic::Response<super::GetUserInfoReply>,
tonic::Status,
>;
}
#[derive(Debug)]
pub struct GalleryInterfaceServer<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> GalleryInterfaceServer<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 GalleryInterfaceServer<T>
where
T: GalleryInterface,
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.pangu.gallery.v1.GalleryInterface/AgreePolicy" => {
#[allow(non_camel_case_types)]
struct AgreePolicySvc<T: GalleryInterface>(pub Arc<T>);
impl<
T: GalleryInterface,
> tonic::server::UnaryService<super::AgreePolicyReq>
for AgreePolicySvc<T> {
type Response = super::AgreePolicyReply;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::AgreePolicyReq>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as GalleryInterface>::agree_policy(&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 = AgreePolicySvc(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.pangu.gallery.v1.GalleryInterface/BasicInfo" => {
#[allow(non_camel_case_types)]
struct BasicInfoSvc<T: GalleryInterface>(pub Arc<T>);
impl<
T: GalleryInterface,
> tonic::server::UnaryService<super::BasicInfoReq>
for BasicInfoSvc<T> {
type Response = super::BasicInfoReply;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::BasicInfoReq>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as GalleryInterface>::basic_info(&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 = BasicInfoSvc(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.pangu.gallery.v1.GalleryInterface/GetBanners" => {
#[allow(non_camel_case_types)]
struct GetBannersSvc<T: GalleryInterface>(pub Arc<T>);
impl<
T: GalleryInterface,
> tonic::server::UnaryService<super::GetBannersReq>
for GetBannersSvc<T> {
type Response = super::GetBannersReply;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::GetBannersReq>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as GalleryInterface>::get_banners(&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 = GetBannersSvc(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.pangu.gallery.v1.GalleryInterface/GetLastPolicy" => {
#[allow(non_camel_case_types)]
struct GetLastPolicySvc<T: GalleryInterface>(pub Arc<T>);
impl<
T: GalleryInterface,
> tonic::server::UnaryService<super::GetLastPolicyReq>
for GetLastPolicySvc<T> {
type Response = super::GetLastPolicyReply;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::GetLastPolicyReq>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as GalleryInterface>::get_last_policy(&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 = GetLastPolicySvc(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.pangu.gallery.v1.GalleryInterface/ListNFTByMid" => {
#[allow(non_camel_case_types)]
struct ListNFTByMidSvc<T: GalleryInterface>(pub Arc<T>);
impl<
T: GalleryInterface,
> tonic::server::UnaryService<super::ListNftByMidReq>
for ListNFTByMidSvc<T> {
type Response = super::ListNftByMidReply;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::ListNftByMidReq>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as GalleryInterface>::list_nft_by_mid(&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 = ListNFTByMidSvc(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.pangu.gallery.v1.GalleryInterface/ListOrderByMid" => {
#[allow(non_camel_case_types)]
struct ListOrderByMidSvc<T: GalleryInterface>(pub Arc<T>);
impl<
T: GalleryInterface,
> tonic::server::UnaryService<super::ListOrderByMidReq>
for ListOrderByMidSvc<T> {
type Response = super::ListOrderByMidReply;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::ListOrderByMidReq>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as GalleryInterface>::list_order_by_mid(&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 = ListOrderByMidSvc(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.pangu.gallery.v1.GalleryInterface/MinePage" => {
#[allow(non_camel_case_types)]
struct MinePageSvc<T: GalleryInterface>(pub Arc<T>);
impl<
T: GalleryInterface,
> tonic::server::UnaryService<super::MinePageReq>
for MinePageSvc<T> {
type Response = super::MinePageReply;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::MinePageReq>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as GalleryInterface>::mine_page(&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 = MinePageSvc(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.pangu.gallery.v1.GalleryInterface/Ping" => {
#[allow(non_camel_case_types)]
struct PingSvc<T: GalleryInterface>(pub Arc<T>);
impl<T: GalleryInterface> 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 GalleryInterface>::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.pangu.gallery.v1.GalleryInterface/UserCheck" => {
#[allow(non_camel_case_types)]
struct UserCheckSvc<T: GalleryInterface>(pub Arc<T>);
impl<
T: GalleryInterface,
> tonic::server::UnaryService<super::UserCheckReq>
for UserCheckSvc<T> {
type Response = super::UserCheckReply;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::UserCheckReq>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as GalleryInterface>::user_check(&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 = UserCheckSvc(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.pangu.gallery.v1.GalleryInterface/UserInfo" => {
#[allow(non_camel_case_types)]
struct UserInfoSvc<T: GalleryInterface>(pub Arc<T>);
impl<
T: GalleryInterface,
> tonic::server::UnaryService<super::GetUserInfoReq>
for UserInfoSvc<T> {
type Response = super::GetUserInfoReply;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::GetUserInfoReq>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as GalleryInterface>::user_info(&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 = UserInfoSvc(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 GalleryInterfaceServer<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.pangu.gallery.v1.GalleryInterface";
impl<T> tonic::server::NamedService for GalleryInterfaceServer<T> {
const NAME: &'static str = SERVICE_NAME;
}
}