pub struct StateRequestBuilder { /* private fields */ }Implementations§
Source§impl StateRequestBuilder
impl StateRequestBuilder
Sourcepub fn with_bbox(self, bbox: BoundingBox) -> Self
pub fn with_bbox(self, bbox: BoundingBox) -> Self
Adds the provided bounding box to the request. This will only get states that are within that bounding box. This will overwrite any previously specified bounding box.
Sourcepub fn at_time(self, timestamp: u64) -> Self
pub fn at_time(self, timestamp: u64) -> Self
Specifies the time at which to get the data. The validity of this timestamp depends on how much access the user has to historical data.
This time is specified as the time in seconds since the Unix Epoch.
Sourcepub fn with_icao24(self, address: String) -> Self
pub fn with_icao24(self, address: String) -> Self
Adds an ICAO24 transponder address represented by a hex string (e.g. abc9f3) to filter the request by. Calling this function multiple times will append more addresses which will be included in the returned data.
If this function is never called, it will provide data for all aircraft.
Sourcepub fn with_serial(self, serial: u64) -> Self
pub fn with_serial(self, serial: u64) -> Self
Adds a serial number of a sensor that you own. This must be owned by you and registered in order to not return an HTTP error 403 (Forbidden). Requests from your own sensors are not ratelimited.
Calling this function multiple times will append more serial numbers of receiviers which provide the returned data.
Sourcepub fn consume(self) -> StateRequest
pub fn consume(self) -> StateRequest
Consumes this StateRequestBuilder and returns a new StateRequest. If this StateRequestBuilder could be used again effectively, then the finish() method should be called instead because that will allow this to be reused.
Sourcepub fn finish(&self) -> StateRequest
pub fn finish(&self) -> StateRequest
Returns the StateRequest that this StateRequestBuilder has created. This clones the inner StateRequest. If this StateRequestBuilder will be only used once, the consume() method should be used instead which will only move the inner value instead of calling clone()
Sourcepub async fn send(self) -> Result<OpenSkyStates, Error>
pub async fn send(self) -> Result<OpenSkyStates, Error>
Consumes this StateRequestBuilder and sends the request to the API.