pub struct TileProcessor { /* private fields */ }Expand description
Base struct for tile processors that wrap a single upstream source.
This struct provides:
- Storage for the upstream source
- Cloned metadata (parameters,
TileJSON, traversal) from the source - Builder pattern for modifying metadata
- Accessor methods for implementation convenience
Processors should embed this struct and delegate trait method implementations to its methods where appropriate.
Implementations§
Source§impl TileProcessor
impl TileProcessor
Sourcepub fn new(name: impl Into<String>, source: Box<dyn TileSource>) -> Self
pub fn new(name: impl Into<String>, source: Box<dyn TileSource>) -> Self
Creates a new processor wrapping the given source.
Clones metadata (parameters, TileJSON, traversal) from the source, which can
then be modified via builder methods.
§Arguments
name- Human-readable name for this processor (e.g., “filter”, “converter”)source- The upstream tile source to wrap
Sourcepub fn with_parameters(self, parameters: TileSourceMetadata) -> Self
pub fn with_parameters(self, parameters: TileSourceMetadata) -> Self
Builder method to override the parameters.
Use this when the processor modifies spatial extent, compression, or format.
Sourcepub fn with_tilejson(self, tilejson: TileJSON) -> Self
pub fn with_tilejson(self, tilejson: TileJSON) -> Self
Builder method to override the TileJSON metadata.
Use this when the processor modifies metadata (e.g., updating attribution, bounds).
Sourcepub fn with_traversal(self, traversal: Traversal) -> Self
pub fn with_traversal(self, traversal: Traversal) -> Self
Builder method to override the traversal hint.
Use this when the processor has a preferred read order different from its source.
Sourcepub fn source(&self) -> &dyn TileSource
pub fn source(&self) -> &dyn TileSource
Returns the upstream source as a trait object reference.
Sourcepub fn source_mut(&mut self) -> &mut Box<dyn TileSource>
pub fn source_mut(&mut self) -> &mut Box<dyn TileSource>
Returns a mutable reference to the boxed source.
Use this when you need to call mutable methods on the source (e.g., override_compression).
Sourcepub fn parameters(&self) -> &TileSourceMetadata
pub fn parameters(&self) -> &TileSourceMetadata
Returns the (potentially modified) parameters.
Sourcepub fn parameters_mut(&mut self) -> &mut TileSourceMetadata
pub fn parameters_mut(&mut self) -> &mut TileSourceMetadata
Returns a mutable reference to the parameters.
Use this to modify parameters after construction.
Sourcepub fn tilejson_mut(&mut self) -> &mut TileJSON
pub fn tilejson_mut(&mut self) -> &mut TileJSON
Returns a mutable reference to the TileJSON.
Use this to modify metadata after construction.
Sourcepub fn traversal_mut(&mut self) -> &mut Traversal
pub fn traversal_mut(&mut self) -> &mut Traversal
Returns a mutable reference to the traversal hint.
Use this to modify traversal after construction.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for TileProcessor
impl !RefUnwindSafe for TileProcessor
impl Send for TileProcessor
impl Sync for TileProcessor
impl Unpin for TileProcessor
impl !UnwindSafe for TileProcessor
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
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>
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>
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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.