pub trait DataSourceExt: IsA<DataSource> + 'static {
// Provided methods
fn max_zoom_level(&self) -> u32 { ... }
fn min_zoom_level(&self) -> u32 { ... }
fn tile_data_async<P: FnOnce(Result<Option<Bytes>, Error>) + 'static>(
&self,
x: i32,
y: i32,
zoom_level: i32,
cancellable: Option<&impl IsA<Cancellable>>,
callback: P,
) { ... }
fn tile_data_future(
&self,
x: i32,
y: i32,
zoom_level: i32,
) -> Pin<Box_<dyn Future<Output = Result<Option<Bytes>, Error>> + 'static>> { ... }
fn set_max_zoom_level(&self, zoom_level: u32) { ... }
fn set_min_zoom_level(&self, zoom_level: u32) { ... }
fn start_request(
&self,
x: i32,
y: i32,
zoom_level: i32,
cancellable: Option<&impl IsA<Cancellable>>,
) -> Option<DataSourceRequest> { ... }
fn connect_received_data<F: Fn(&Self, i32, i32, i32, &Bytes) + 'static>(
&self,
f: F,
) -> SignalHandlerId { ... }
fn connect_max_zoom_level_notify<F: Fn(&Self) + 'static>(
&self,
f: F,
) -> SignalHandlerId { ... }
fn connect_min_zoom_level_notify<F: Fn(&Self) + 'static>(
&self,
f: F,
) -> SignalHandlerId { ... }
}Expand description
Provided Methods§
Sourcefn max_zoom_level(&self) -> u32
fn max_zoom_level(&self) -> u32
Gets the data source’s maximum zoom level.
§Returns
the maximum zoom level this data source supports
Sourcefn min_zoom_level(&self) -> u32
fn min_zoom_level(&self) -> u32
Gets the data source’s minimum zoom level.
§Returns
the minimum zoom level this data source supports
Sourcefn tile_data_async<P: FnOnce(Result<Option<Bytes>, Error>) + 'static>(
&self,
x: i32,
y: i32,
zoom_level: i32,
cancellable: Option<&impl IsA<Cancellable>>,
callback: P,
)
fn tile_data_async<P: FnOnce(Result<Option<Bytes>, Error>) + 'static>( &self, x: i32, y: i32, zoom_level: i32, cancellable: Option<&impl IsA<Cancellable>>, callback: P, )
Gets the data for the tile at the given coordinates.
Some data sources may return data multiple times. For example,
TileDownloader may return data from a cache, then return updated
data from the network. [received-data][struct@crate::ShumateDataSource#received-data] is emitted
each time data is received, then @callback is called after the last update.
§x
the X coordinate to fetch
§y
the Y coordinate to fetch
§zoom_level
the Z coordinate to fetch
§cancellable
a #GCancellable
§callback
a #GAsyncReadyCallback to execute upon completion
fn tile_data_future( &self, x: i32, y: i32, zoom_level: i32, ) -> Pin<Box_<dyn Future<Output = Result<Option<Bytes>, Error>> + 'static>>
Sourcefn set_max_zoom_level(&self, zoom_level: u32)
fn set_max_zoom_level(&self, zoom_level: u32)
Sourcefn set_min_zoom_level(&self, zoom_level: u32)
fn set_min_zoom_level(&self, zoom_level: u32)
Sourcefn start_request(
&self,
x: i32,
y: i32,
zoom_level: i32,
cancellable: Option<&impl IsA<Cancellable>>,
) -> Option<DataSourceRequest>
fn start_request( &self, x: i32, y: i32, zoom_level: i32, cancellable: Option<&impl IsA<Cancellable>>, ) -> Option<DataSourceRequest>
Sourcefn connect_received_data<F: Fn(&Self, i32, i32, i32, &Bytes) + 'static>(
&self,
f: F,
) -> SignalHandlerId
👎Deprecated: Since 1.1
fn connect_received_data<F: Fn(&Self, i32, i32, i32, &Bytes) + 'static>( &self, f: F, ) -> SignalHandlerId
Since 1.1
Emitted when data is received for any tile. This includes any intermediate steps, such as data from the file cache, as well as the final result.
§Deprecated since 1.1
Use start_request() and connect to the
notify signals of the resulting DataSourceRequest.
§x
the X coordinate of the tile
§y
the Y coordinate of the tile
§zoom_level
the zoom level of the tile
§bytes
the received data
fn connect_max_zoom_level_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId
fn connect_min_zoom_level_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".