|
|
@@ -16,7 +16,7 @@ enum Placeholder {
|
|
16
|
16
|
}
|
|
17
|
17
|
|
|
18
|
18
|
impl Placeholder {
|
|
19
|
|
- /// Returns maximum number of bytes that the value for a placeholder with occupy.
|
|
|
19
|
+ /// Returns maximum number of bytes that the value for a placeholder will occupy.
|
|
20
|
20
|
fn max_size(&self) -> usize {
|
|
21
|
21
|
match *self {
|
|
22
|
22
|
Placeholder::X | Placeholder::Y | Placeholder::Z => 11,
|
|
|
@@ -25,11 +25,12 @@ impl Placeholder {
|
|
25
|
25
|
}
|
|
26
|
26
|
}
|
|
27
|
27
|
|
|
|
28
|
+/// A template for tile URLs that can be efficiently filled with values from a `TileCoord`.
|
|
28
|
29
|
#[derive(Debug)]
|
|
29
|
30
|
pub struct UrlTemplate {
|
|
30
|
31
|
/// The template string that includes placeholders between static parts
|
|
31
|
32
|
template_string: String,
|
|
32
|
|
- /// Ranges into `template_string` for static parts
|
|
|
33
|
+ /// Ranges into `template_string` for the static parts
|
|
33
|
34
|
static_parts: Vec<::std::ops::Range<usize>>,
|
|
34
|
35
|
/// Kinds of placeholders between the static parts
|
|
35
|
36
|
placeholders: Vec<Placeholder>,
|