// Licensed to the Apache Software Foundation (ASF) under one // or more contributor license agreements. See the NOTICE file // distributed with this work for additional information // regarding copyright ownership. The ASF licenses this file // to you under the Apache License, Version 2.0 (the // "License"); you may not use this file except in compliance // with the License. You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, // software distributed under the License is distributed on an // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY // KIND, either express or implied. See the License for the // specific language governing permissions and limitations // under the License. use futures::stream::BoxStream; use tonic::transport::Server; use tonic::{Request, Response, Status, Streaming}; use arrow_flight::{ flight_service_server::FlightService, flight_service_server::FlightServiceServer, Action, ActionType, Criteria, Empty, FlightData, FlightDescriptor, FlightInfo, HandshakeRequest, HandshakeResponse, PollInfo, PutResult, SchemaResult, Ticket, }; #[derive(Clone)] pub struct FlightServiceImpl {} #[tonic::async_trait] impl FlightService for FlightServiceImpl { type HandshakeStream = BoxStream<'static, Result>; type ListFlightsStream = BoxStream<'static, Result>; type DoGetStream = BoxStream<'static, Result>; type DoPutStream = BoxStream<'static, Result>; type DoActionStream = BoxStream<'static, Result>; type ListActionsStream = BoxStream<'static, Result>; type DoExchangeStream = BoxStream<'static, Result>; async fn handshake( &self, _request: Request>, ) -> Result, Status> { Err(Status::unimplemented("Implement handshake")) } async fn list_flights( &self, _request: Request, ) -> Result, Status> { Err(Status::unimplemented("Implement list_flights")) } async fn get_flight_info( &self, _request: Request, ) -> Result, Status> { Err(Status::unimplemented("Implement get_flight_info")) } async fn poll_flight_info( &self, _request: Request, ) -> Result, Status> { Err(Status::unimplemented("Implement poll_flight_info")) } async fn get_schema( &self, _request: Request, ) -> Result, Status> { Err(Status::unimplemented("Implement get_schema")) } async fn do_get( &self, _request: Request, ) -> Result, Status> { Err(Status::unimplemented("Implement do_get")) } async fn do_put( &self, _request: Request>, ) -> Result, Status> { Err(Status::unimplemented("Implement do_put")) } async fn do_action( &self, _request: Request, ) -> Result, Status> { Err(Status::unimplemented("Implement do_action")) } async fn list_actions( &self, _request: Request, ) -> Result, Status> { Err(Status::unimplemented("Implement list_actions")) } async fn do_exchange( &self, _request: Request>, ) -> Result, Status> { Err(Status::unimplemented("Implement do_exchange")) } } #[tokio::main] async fn main() -> Result<(), Box> { let addr = "[::1]:50051".parse()?; let service = FlightServiceImpl {}; let svc = FlightServiceServer::new(service); Server::builder().add_service(svc).serve(addr).await?; Ok(()) }