pub struct FlightEndpoint {
pub ticket: Option<Ticket>,
pub location: Vec<Location>,
pub expiration_time: Option<Timestamp>,
pub app_metadata: Bytes,
}
Expand description
A particular stream or split associated with a flight.
Fields§
§ticket: Option<Ticket>
Token used to retrieve this stream.
location: Vec<Location>
A list of URIs where this ticket can be redeemed via DoGet().
If the list is empty, the expectation is that the ticket can only be redeemed on the current service where the ticket was generated.
If the list is not empty, the expectation is that the ticket can be redeemed at any of the locations, and that the data returned will be equivalent. In this case, the ticket may only be redeemed at one of the given locations, and not (necessarily) on the current service.
In other words, an application can use multiple locations to represent redundant and/or load balanced services.
expiration_time: Option<Timestamp>
Expiration time of this stream. If present, clients may assume they can retry DoGet requests. Otherwise, it is application-defined whether DoGet requests may be retried.
app_metadata: Bytes
Application-defined metadata.
There is no inherent or required relationship between this and the app_metadata fields in the FlightInfo or resulting FlightData messages. Since this metadata is application-defined, a given application could define there to be a relationship, but there is none required by the spec.
Implementations§
Source§impl FlightEndpoint
impl FlightEndpoint
Sourcepub fn new() -> FlightEndpoint
pub fn new() -> FlightEndpoint
Create a new, empty FlightEndpoint
that represents a location
to retrieve Flight results.
§Example
// Specify the client should fetch results from this server
let endpoint = FlightEndpoint::new()
.with_ticket(Ticket::new("the ticket"));
// Specify the client should fetch results from either
// `http://example.com` or `https://example.com`
let endpoint = FlightEndpoint::new()
.with_ticket(Ticket::new("the ticket"))
.with_location("http://example.com")
.with_location("https://example.com");
Sourcepub fn with_ticket(self, ticket: Ticket) -> Self
pub fn with_ticket(self, ticket: Ticket) -> Self
Set the Ticket
used to retrieve data from the endpoint
Sourcepub fn with_location(self, uri: impl Into<String>) -> Self
pub fn with_location(self, uri: impl Into<String>) -> Self
Add a location uri
to this endpoint. Note each endpoint can
have multiple locations.
If no uri
is specified, the Flight Spec says:
* If the list is empty, the expectation is that the ticket can only
* be redeemed on the current service where the ticket was
* generated.
Sourcepub fn with_expiration_time(self, expiration_time: Timestamp) -> Self
pub fn with_expiration_time(self, expiration_time: Timestamp) -> Self
Specify expiration time for this stream
Sourcepub fn with_app_metadata(self, app_metadata: impl Into<Bytes>) -> Self
pub fn with_app_metadata(self, app_metadata: impl Into<Bytes>) -> Self
Add optional application specific metadata to the message
Trait Implementations§
Source§impl Clone for FlightEndpoint
impl Clone for FlightEndpoint
Source§fn clone(&self) -> FlightEndpoint
fn clone(&self) -> FlightEndpoint
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for FlightEndpoint
impl Debug for FlightEndpoint
Source§impl Default for FlightEndpoint
impl Default for FlightEndpoint
Source§impl Display for FlightEndpoint
impl Display for FlightEndpoint
Source§impl Message for FlightEndpoint
impl Message for FlightEndpoint
Source§fn encoded_len(&self) -> usize
fn encoded_len(&self) -> usize
Source§fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>where
Self: Sized,
fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>where
Self: Sized,
Source§fn encode_to_vec(&self) -> Vec<u8>where
Self: Sized,
fn encode_to_vec(&self) -> Vec<u8>where
Self: Sized,
Source§fn encode_length_delimited(
&self,
buf: &mut impl BufMut,
) -> Result<(), EncodeError>where
Self: Sized,
fn encode_length_delimited(
&self,
buf: &mut impl BufMut,
) -> Result<(), EncodeError>where
Self: Sized,
Source§fn encode_length_delimited_to_vec(&self) -> Vec<u8>where
Self: Sized,
fn encode_length_delimited_to_vec(&self) -> Vec<u8>where
Self: Sized,
Source§fn decode(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
fn decode(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
Source§fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
Source§fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
self
. Read moreSource§fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
self
.Source§impl PartialEq for FlightEndpoint
impl PartialEq for FlightEndpoint
impl StructuralPartialEq for FlightEndpoint
Auto Trait Implementations§
impl !Freeze for FlightEndpoint
impl RefUnwindSafe for FlightEndpoint
impl Send for FlightEndpoint
impl Sync for FlightEndpoint
impl Unpin for FlightEndpoint
impl UnwindSafe for FlightEndpoint
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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