diff --git a/grpc/src/asseturls.rs b/grpc/src/asseturls.rs index ad9079f3..1cd7b540 100644 --- a/grpc/src/asseturls.rs +++ b/grpc/src/asseturls.rs @@ -90,8 +90,7 @@ impl DownloadError { /// Generated client implementations. pub mod asset_url_service_client { #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] - use tonic::codegen::*; - use tonic::codegen::http::Uri; + use tonic::codegen::{http::Uri, *}; #[derive(Debug, Clone)] pub struct AssetUrlServiceClient { inner: tonic::client::Grpc, @@ -135,9 +134,8 @@ pub mod asset_url_service_client { >::ResponseBody, >, >, - , - >>::Error: Into + Send + Sync, + >>::Error: + Into + Send + Sync, { AssetUrlServiceClient::new(InterceptedService::new(inner, interceptor)) } @@ -176,31 +174,20 @@ pub mod asset_url_service_client { pub async fn get_asset_urls_to_download( &mut self, request: impl tonic::IntoRequest, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - > { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; + ) -> std::result::Result, tonic::Status> { + self.inner.ready().await.map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( "/asseturls.AssetUrlService/GetAssetUrlsToDownload", ); let mut req = request.into_request(); req.extensions_mut() - .insert( - GrpcMethod::new( - "asseturls.AssetUrlService", - "GetAssetUrlsToDownload", - ), - ); + .insert(GrpcMethod::new("asseturls.AssetUrlService", "GetAssetUrlsToDownload")); self.inner.unary(req, path, codec).await } /// Used to notify about asset download results @@ -208,24 +195,19 @@ pub mod asset_url_service_client { &mut self, request: impl tonic::IntoRequest, ) -> std::result::Result, tonic::Status> { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; + self.inner.ready().await.map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( "/asseturls.AssetUrlService/SubmitDownloadResult", ); let mut req = request.into_request(); req.extensions_mut() - .insert( - GrpcMethod::new("asseturls.AssetUrlService", "SubmitDownloadResult"), - ); + .insert(GrpcMethod::new("asseturls.AssetUrlService", "SubmitDownloadResult")); self.inner.unary(req, path, codec).await } } @@ -241,10 +223,7 @@ pub mod asset_url_service_server { async fn get_asset_urls_to_download( &self, request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; + ) -> std::result::Result, tonic::Status>; /// Used to notify about asset download results async fn submit_download_result( &self, @@ -274,10 +253,7 @@ pub mod asset_url_service_server { max_encoding_message_size: None, } } - pub fn with_interceptor( - inner: T, - interceptor: F, - ) -> InterceptedService + pub fn with_interceptor(inner: T, interceptor: F) -> InterceptedService where F: tonic::service::Interceptor, { @@ -333,25 +309,18 @@ pub mod asset_url_service_server { "/asseturls.AssetUrlService/GetAssetUrlsToDownload" => { #[allow(non_camel_case_types)] struct GetAssetUrlsToDownloadSvc(pub Arc); - impl< - T: AssetUrlService, - > tonic::server::UnaryService - for GetAssetUrlsToDownloadSvc { + impl tonic::server::UnaryService + for GetAssetUrlsToDownloadSvc + { type Response = super::AssetsToDownload; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; + type Future = BoxFuture, tonic::Status>; fn call( &mut self, request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::get_asset_urls_to_download( - &inner, - request, - ) + ::get_asset_urls_to_download(&inner, request) .await }; Box::pin(fut) @@ -379,29 +348,23 @@ pub mod asset_url_service_server { Ok(res) }; Box::pin(fut) - } + }, "/asseturls.AssetUrlService/SubmitDownloadResult" => { #[allow(non_camel_case_types)] struct SubmitDownloadResultSvc(pub Arc); - impl< - T: AssetUrlService, - > tonic::server::UnaryService - for SubmitDownloadResultSvc { + impl + tonic::server::UnaryService + for SubmitDownloadResultSvc + { type Response = (); - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; + type Future = BoxFuture, tonic::Status>; fn call( &mut self, request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::submit_download_result( - &inner, - request, - ) + ::submit_download_result(&inner, request) .await }; Box::pin(fut) @@ -429,19 +392,15 @@ pub mod asset_url_service_server { Ok(res) }; Box::pin(fut) - } - _ => { - Box::pin(async move { - Ok( - http::Response::builder() - .status(200) - .header("grpc-status", "12") - .header("content-type", "application/grpc") - .body(empty_body()) - .unwrap(), - ) - }) - } + }, + _ => Box::pin(async move { + Ok(http::Response::builder() + .status(200) + .header("grpc-status", "12") + .header("content-type", "application/grpc") + .body(empty_body()) + .unwrap()) + }), } } } diff --git a/grpc/src/gapfiller.rs b/grpc/src/gapfiller.rs index 01ff50ab..18cb4cf9 100644 --- a/grpc/src/gapfiller.rs +++ b/grpc/src/gapfiller.rs @@ -444,22 +444,16 @@ impl SpecificationAssetClass { pub fn as_str_name(&self) -> &'static str { match self { SpecificationAssetClass::Unknown => "SPECIFICATION_ASSET_CLASS_UNKNOWN", - SpecificationAssetClass::FungibleToken => { - "SPECIFICATION_ASSET_CLASS_FUNGIBLE_TOKEN" - } - SpecificationAssetClass::FungibleAsset => { - "SPECIFICATION_ASSET_CLASS_FUNGIBLE_ASSET" - } + SpecificationAssetClass::FungibleToken => "SPECIFICATION_ASSET_CLASS_FUNGIBLE_TOKEN", + SpecificationAssetClass::FungibleAsset => "SPECIFICATION_ASSET_CLASS_FUNGIBLE_ASSET", SpecificationAssetClass::Nft => "SPECIFICATION_ASSET_CLASS_NFT", SpecificationAssetClass::ProgrammableNft => { "SPECIFICATION_ASSET_CLASS_PROGRAMMABLE_NFT" - } - SpecificationAssetClass::MplCoreAsset => { - "SPECIFICATION_ASSET_CLASS_MPL_CORE_ASSET" - } + }, + SpecificationAssetClass::MplCoreAsset => "SPECIFICATION_ASSET_CLASS_MPL_CORE_ASSET", SpecificationAssetClass::MplCoreCollection => { "SPECIFICATION_ASSET_CLASS_MPL_CORE_COLLECTION" - } + }, } } /// Creates an enum from field names used in the ProtoBuf definition. @@ -471,9 +465,7 @@ impl SpecificationAssetClass { "SPECIFICATION_ASSET_CLASS_NFT" => Some(Self::Nft), "SPECIFICATION_ASSET_CLASS_PROGRAMMABLE_NFT" => Some(Self::ProgrammableNft), "SPECIFICATION_ASSET_CLASS_MPL_CORE_ASSET" => Some(Self::MplCoreAsset), - "SPECIFICATION_ASSET_CLASS_MPL_CORE_COLLECTION" => { - Some(Self::MplCoreCollection) - } + "SPECIFICATION_ASSET_CLASS_MPL_CORE_COLLECTION" => Some(Self::MplCoreCollection), _ => None, } } @@ -555,9 +547,7 @@ impl TokenStandard { TokenStandard::Fungible => "FUNGIBLE", TokenStandard::NonFungibleEdition => "NON_FUNGIBLE_EDITION", TokenStandard::ProgrammableNonFungible => "PROGRAMMABLE_NON_FUNGIBLE", - TokenStandard::ProgrammableNonFungibleEdition => { - "PROGRAMMABLE_NON_FUNGIBLE_EDITION" - } + TokenStandard::ProgrammableNonFungibleEdition => "PROGRAMMABLE_NON_FUNGIBLE_EDITION", } } /// Creates an enum from field names used in the ProtoBuf definition. @@ -568,9 +558,7 @@ impl TokenStandard { "FUNGIBLE" => Some(Self::Fungible), "NON_FUNGIBLE_EDITION" => Some(Self::NonFungibleEdition), "PROGRAMMABLE_NON_FUNGIBLE" => Some(Self::ProgrammableNonFungible), - "PROGRAMMABLE_NON_FUNGIBLE_EDITION" => { - Some(Self::ProgrammableNonFungibleEdition) - } + "PROGRAMMABLE_NON_FUNGIBLE_EDITION" => Some(Self::ProgrammableNonFungibleEdition), _ => None, } } @@ -633,8 +621,7 @@ impl UpdateVersion { /// Generated client implementations. pub mod gap_filler_service_client { #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] - use tonic::codegen::*; - use tonic::codegen::http::Uri; + use tonic::codegen::{http::Uri, *}; /// Define the gRPC service #[derive(Debug, Clone)] pub struct GapFillerServiceClient { @@ -679,9 +666,8 @@ pub mod gap_filler_service_client { >::ResponseBody, >, >, - , - >>::Error: Into + Send + Sync, + >>::Error: + Into + Send + Sync, { GapFillerServiceClient::new(InterceptedService::new(inner, interceptor)) } @@ -723,27 +709,19 @@ pub mod gap_filler_service_client { tonic::Response>, tonic::Status, > { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; + self.inner.ready().await.map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( "/gapfiller.GapFillerService/GetAssetsUpdatedWithin", ); let mut req = request.into_request(); req.extensions_mut() - .insert( - GrpcMethod::new( - "gapfiller.GapFillerService", - "GetAssetsUpdatedWithin", - ), - ); + .insert(GrpcMethod::new("gapfiller.GapFillerService", "GetAssetsUpdatedWithin")); self.inner.server_streaming(req, path, codec).await } pub async fn get_raw_blocks_within( @@ -753,43 +731,34 @@ pub mod gap_filler_service_client { tonic::Response>, tonic::Status, > { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; + self.inner.ready().await.map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( "/gapfiller.GapFillerService/GetRawBlocksWithin", ); let mut req = request.into_request(); req.extensions_mut() - .insert( - GrpcMethod::new("gapfiller.GapFillerService", "GetRawBlocksWithin"), - ); + .insert(GrpcMethod::new("gapfiller.GapFillerService", "GetRawBlocksWithin")); self.inner.server_streaming(req, path, codec).await } pub async fn get_raw_block( &mut self, request: impl tonic::IntoRequest, ) -> std::result::Result, tonic::Status> { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; + self.inner.ready().await.map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/gapfiller.GapFillerService/GetRawBlock", - ); + let path = + http::uri::PathAndQuery::from_static("/gapfiller.GapFillerService/GetRawBlock"); let mut req = request.into_request(); req.extensions_mut() .insert(GrpcMethod::new("gapfiller.GapFillerService", "GetRawBlock")); @@ -807,29 +776,21 @@ pub mod gap_filler_service_server { /// Server streaming response type for the GetAssetsUpdatedWithin method. type GetAssetsUpdatedWithinStream: tonic::codegen::tokio_stream::Stream< Item = std::result::Result, - > - + Send + > + Send + 'static; async fn get_assets_updated_within( &self, request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; + ) -> std::result::Result, tonic::Status>; /// Server streaming response type for the GetRawBlocksWithin method. type GetRawBlocksWithinStream: tonic::codegen::tokio_stream::Stream< Item = std::result::Result, - > - + Send + > + Send + 'static; async fn get_raw_blocks_within( &self, request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; + ) -> std::result::Result, tonic::Status>; async fn get_raw_block( &self, request: tonic::Request, @@ -859,10 +820,7 @@ pub mod gap_filler_service_server { max_encoding_message_size: None, } } - pub fn with_interceptor( - inner: T, - interceptor: F, - ) -> InterceptedService + pub fn with_interceptor(inner: T, interceptor: F) -> InterceptedService where F: tonic::service::Interceptor, { @@ -918,26 +876,21 @@ pub mod gap_filler_service_server { "/gapfiller.GapFillerService/GetAssetsUpdatedWithin" => { #[allow(non_camel_case_types)] struct GetAssetsUpdatedWithinSvc(pub Arc); - impl< - T: GapFillerService, - > tonic::server::ServerStreamingService - for GetAssetsUpdatedWithinSvc { + impl + tonic::server::ServerStreamingService + for GetAssetsUpdatedWithinSvc + { type Response = super::AssetDetails; type ResponseStream = T::GetAssetsUpdatedWithinStream; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; + type Future = + BoxFuture, tonic::Status>; fn call( &mut self, request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::get_assets_updated_within( - &inner, - request, - ) + ::get_assets_updated_within(&inner, request) .await }; Box::pin(fut) @@ -965,30 +918,25 @@ pub mod gap_filler_service_server { Ok(res) }; Box::pin(fut) - } + }, "/gapfiller.GapFillerService/GetRawBlocksWithin" => { #[allow(non_camel_case_types)] struct GetRawBlocksWithinSvc(pub Arc); - impl< - T: GapFillerService, - > tonic::server::ServerStreamingService - for GetRawBlocksWithinSvc { + impl + tonic::server::ServerStreamingService + for GetRawBlocksWithinSvc + { type Response = super::RawBlock; type ResponseStream = T::GetRawBlocksWithinStream; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; + type Future = + BoxFuture, tonic::Status>; fn call( &mut self, request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::get_raw_blocks_within( - &inner, - request, - ) + ::get_raw_blocks_within(&inner, request) .await }; Box::pin(fut) @@ -1016,27 +964,22 @@ pub mod gap_filler_service_server { Ok(res) }; Box::pin(fut) - } + }, "/gapfiller.GapFillerService/GetRawBlock" => { #[allow(non_camel_case_types)] struct GetRawBlockSvc(pub Arc); - impl< - T: GapFillerService, - > tonic::server::UnaryService - for GetRawBlockSvc { + impl tonic::server::UnaryService + for GetRawBlockSvc + { type Response = super::RawBlock; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; + type Future = BoxFuture, tonic::Status>; fn call( &mut self, request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::get_raw_block(&inner, request) - .await + ::get_raw_block(&inner, request).await }; Box::pin(fut) } @@ -1063,19 +1006,15 @@ pub mod gap_filler_service_server { Ok(res) }; Box::pin(fut) - } - _ => { - Box::pin(async move { - Ok( - http::Response::builder() - .status(200) - .header("grpc-status", "12") - .header("content-type", "application/grpc") - .body(empty_body()) - .unwrap(), - ) - }) - } + }, + _ => Box::pin(async move { + Ok(http::Response::builder() + .status(200) + .header("grpc-status", "12") + .header("content-type", "application/grpc") + .body(empty_body()) + .unwrap()) + }), } } }