pub struct PushPolicy {
pub max_push_count: u8,
pub min_zoom: u8,
pub max_zoom: u8,
pub formats: Vec<TileFormat>,
pub base_url: String,
}Expand description
Decides which neighbouring tiles to push alongside a tile request.
Fields§
§max_push_count: u8Maximum number of push hints to generate per request.
min_zoom: u8Minimum zoom level to consider for push hints.
max_zoom: u8Maximum zoom level to consider for push hints.
formats: Vec<TileFormat>Tile formats to include in push hints.
base_url: StringBase URL prepended to each tile path.
Implementations§
Source§impl PushPolicy
impl PushPolicy
Sourcepub fn new(base_url: impl Into<String>) -> Self
pub fn new(base_url: impl Into<String>) -> Self
Creates a PushPolicy with sensible defaults:
max_push_count=8, zoom 0–22, MVT format.
Sourcepub fn generate_hints(&self, requested: &TileKey) -> Vec<PushHint>
pub fn generate_hints(&self, requested: &TileKey) -> Vec<PushHint>
Generates push hints for the neighbours of requested.
Uses a TilePrefetcher with radius 1, filters by zoom range and format,
and caps the result at max_push_count.
Sourcepub fn to_link_header_value(hints: &[PushHint]) -> String
pub fn to_link_header_value(hints: &[PushHint]) -> String
Joins multiple hints into a single Link header value (comma-separated).
Auto Trait Implementations§
impl Freeze for PushPolicy
impl RefUnwindSafe for PushPolicy
impl Send for PushPolicy
impl Sync for PushPolicy
impl Unpin for PushPolicy
impl UnsafeUnpin for PushPolicy
impl UnwindSafe for PushPolicy
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
Mutably borrows from an owned value. Read more
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> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more