pub struct FlightServiceClient<T> { /* private fields */ }
Expand description
A flight service is an endpoint for retrieving or storing Arrow data. A flight service can expose one or more predefined endpoints that can be accessed using the Arrow Flight Protocol. Additionally, a flight service can expose a set of actions that are available.
Implementations§
source§impl<T> FlightServiceClient<T>where
T: GrpcService<BoxBody>,
T::Error: Into<StdError>,
T::ResponseBody: Body<Data = Bytes> + Send + 'static,
<T::ResponseBody as Body>::Error: Into<StdError> + Send,
impl<T> FlightServiceClient<T>where
T: GrpcService<BoxBody>,
T::Error: Into<StdError>,
T::ResponseBody: Body<Data = Bytes> + Send + 'static,
<T::ResponseBody as Body>::Error: Into<StdError> + Send,
pub fn new(inner: T) -> Self
pub fn with_origin(inner: T, origin: Uri) -> Self
pub fn with_interceptor<F>(
inner: T,
interceptor: F
) -> FlightServiceClient<InterceptedService<T, F>>where
F: Interceptor,
T::ResponseBody: Default,
T: Service<Request<BoxBody>, Response = Response<<T as GrpcService<BoxBody>>::ResponseBody>>,
<T as Service<Request<BoxBody>>>::Error: Into<StdError> + Send + Sync,
sourcepub fn send_compressed(self, encoding: CompressionEncoding) -> Self
pub fn send_compressed(self, encoding: CompressionEncoding) -> Self
Compress requests with the given encoding.
This requires the server to support it otherwise it might respond with an error.
sourcepub fn accept_compressed(self, encoding: CompressionEncoding) -> Self
pub fn accept_compressed(self, encoding: CompressionEncoding) -> Self
Enable decompressing responses.
sourcepub async fn handshake(
&mut self,
request: impl IntoStreamingRequest<Message = HandshakeRequest>
) -> Result<Response<Streaming<HandshakeResponse>>, Status>
pub async fn handshake(
&mut self,
request: impl IntoStreamingRequest<Message = HandshakeRequest>
) -> Result<Response<Streaming<HandshakeResponse>>, Status>
Handshake between client and server. Depending on the server, the handshake may be required to determine the token that should be used for future operations. Both request and response are streams to allow multiple round-trips depending on auth mechanism.
sourcepub async fn list_flights(
&mut self,
request: impl IntoRequest<Criteria>
) -> Result<Response<Streaming<FlightInfo>>, Status>
pub async fn list_flights(
&mut self,
request: impl IntoRequest<Criteria>
) -> Result<Response<Streaming<FlightInfo>>, Status>
Get a list of available streams given a particular criteria. Most flight services will expose one or more streams that are readily available for retrieval. This api allows listing the streams available for consumption. A user can also provide a criteria. The criteria can limit the subset of streams that can be listed via this interface. Each flight service allows its own definition of how to consume criteria.
sourcepub async fn get_flight_info(
&mut self,
request: impl IntoRequest<FlightDescriptor>
) -> Result<Response<FlightInfo>, Status>
pub async fn get_flight_info(
&mut self,
request: impl IntoRequest<FlightDescriptor>
) -> Result<Response<FlightInfo>, Status>
For a given FlightDescriptor, get information about how the flight can be consumed. This is a useful interface if the consumer of the interface already can identify the specific flight to consume. This interface can also allow a consumer to generate a flight stream through a specified descriptor. For example, a flight descriptor might be something that includes a SQL statement or a Pickled Python operation that will be executed. In those cases, the descriptor will not be previously available within the list of available streams provided by ListFlights but will be available for consumption for the duration defined by the specific flight service.
sourcepub async fn get_schema(
&mut self,
request: impl IntoRequest<FlightDescriptor>
) -> Result<Response<SchemaResult>, Status>
pub async fn get_schema(
&mut self,
request: impl IntoRequest<FlightDescriptor>
) -> Result<Response<SchemaResult>, Status>
For a given FlightDescriptor, get the Schema as described in Schema.fbs::Schema This is used when a consumer needs the Schema of flight stream. Similar to GetFlightInfo this interface may generate a new flight that was not previously available in ListFlights.
sourcepub async fn do_get(
&mut self,
request: impl IntoRequest<Ticket>
) -> Result<Response<Streaming<FlightData>>, Status>
pub async fn do_get(
&mut self,
request: impl IntoRequest<Ticket>
) -> Result<Response<Streaming<FlightData>>, Status>
Retrieve a single stream associated with a particular descriptor associated with the referenced ticket. A Flight can be composed of one or more streams where each stream can be retrieved using a separate opaque ticket that the flight service uses for managing a collection of streams.
sourcepub async fn do_put(
&mut self,
request: impl IntoStreamingRequest<Message = FlightData>
) -> Result<Response<Streaming<PutResult>>, Status>
pub async fn do_put(
&mut self,
request: impl IntoStreamingRequest<Message = FlightData>
) -> Result<Response<Streaming<PutResult>>, Status>
Push a stream to the flight service associated with a particular flight stream. This allows a client of a flight service to upload a stream of data. Depending on the particular flight service, a client consumer could be allowed to upload a single stream per descriptor or an unlimited number. In the latter, the service might implement a ‘seal’ action that can be applied to a descriptor once all streams are uploaded.
sourcepub async fn do_exchange(
&mut self,
request: impl IntoStreamingRequest<Message = FlightData>
) -> Result<Response<Streaming<FlightData>>, Status>
pub async fn do_exchange(
&mut self,
request: impl IntoStreamingRequest<Message = FlightData>
) -> Result<Response<Streaming<FlightData>>, Status>
Open a bidirectional data channel for a given descriptor. This allows clients to send and receive arbitrary Arrow data and application-specific metadata in a single logical stream. In contrast to DoGet/DoPut, this is more suited for clients offloading computation (rather than storage) to a Flight service.
sourcepub async fn do_action(
&mut self,
request: impl IntoRequest<Action>
) -> Result<Response<Streaming<Result>>, Status>
pub async fn do_action(
&mut self,
request: impl IntoRequest<Action>
) -> Result<Response<Streaming<Result>>, Status>
Flight services can support an arbitrary number of simple actions in addition to the possible ListFlights, GetFlightInfo, DoGet, DoPut operations that are potentially available. DoAction allows a flight client to do a specific action against a flight service. An action includes opaque request and response objects that are specific to the type action being undertaken.
sourcepub async fn list_actions(
&mut self,
request: impl IntoRequest<Empty>
) -> Result<Response<Streaming<ActionType>>, Status>
pub async fn list_actions(
&mut self,
request: impl IntoRequest<Empty>
) -> Result<Response<Streaming<ActionType>>, Status>
A flight service exposes all of the available action types that it has along with descriptions. This allows different flight consumers to understand the capabilities of the flight service.
Trait Implementations§
source§impl<T: Clone> Clone for FlightServiceClient<T>
impl<T: Clone> Clone for FlightServiceClient<T>
source§fn clone(&self) -> FlightServiceClient<T>
fn clone(&self) -> FlightServiceClient<T>
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreAuto Trait Implementations§
impl<T> RefUnwindSafe for FlightServiceClient<T>where
T: RefUnwindSafe,
impl<T> Send for FlightServiceClient<T>where
T: Send,
impl<T> Sync for FlightServiceClient<T>where
T: Sync,
impl<T> Unpin for FlightServiceClient<T>where
T: Unpin,
impl<T> UnwindSafe for FlightServiceClient<T>where
T: UnwindSafe,
Blanket Implementations§
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T
in a tonic::Request