pub fn read_tile(conn: &rusqlite::Connection, tile_id: TmsTileId) -> rusqlite::Result<Option<Vec<u8>>> {
    let mut select_tile = conn
        .prepare_cached("SELECT tile_data FROM tiles WHERE zoom_level = ?1 AND tile_column = ?2 AND tile_row = ?3")?;
    let mut rows = select_tile.query(params![tile_id.z(), tile_id.x(), tile_id.y()])?;

    if let Some(row) = rows.next()? {
        let tile_data: Vec<u8> = row.get(0)?;
        Ok(Some(tile_data))
    } else {
        Ok(None)
    }
}
/// Reads the given tile from the database.
///
/// If the tile is not found, `None` is returned.
Reads the given tile from the database.
If the tile is not found, `None` is returned.
Reads the given tile from the database . If the tile is not found ` None ` is returned .
pub fn read_tile(conn: &rusqlite::Connection, tile_id: TmsTileId) -> rusqlite::Result<Option<Vec<u8>>> {
    let mut select_tile = conn
        .prepare_cached("SELECT tile_data FROM tiles WHERE zoom_level = ?1 AND tile_column = ?2 AND tile_row = ?3")?;
    let mut rows = select_tile.query(params![tile_id.z(), tile_id.x(), tile_id.y()])?;
    if let Some(row) = rows.next()? {
        let tile_data: Vec<u8> = row.get(0)?;
        Ok(Some(tile_data))
    } else {
        Ok(None)
    }
}
pub fn read_tile ( conn : & rusqlite :: Connection , tile_id : TmsTileId ) -> rusqlite :: Result < Option < Vec < u8 > > > { let mut select_tile = conn . prepare_cached ( " " ) ? ; let mut rows = select_tile . query ( params ! [ tile_id z ( ) tile_id x ( ) tile_id y ( ) ] ) ? ; if let Some ( row ) = rows . next ( ) ? { let tile_data : Vec < u8 > = row . get ( 0 ) ? ; Ok ( Some ( tile_data ) ) } else { Ok ( None ) } }
Reads the given tile from the database.
Reads the given tile from the database .
conn
&rusqlite::Connection
tile_id
TmsTileId