#[non_exhaustive]pub struct ReaderConfig {Show 16 fields
pub max_ifds: usize,
pub max_ifd_entries: u64,
pub snapshot_policy: SnapshotPolicy,
pub max_metadata_bytes: u64,
pub work_budget: WorkBudget,
pub max_window_pixels: u64,
pub max_window_bytes: u64,
pub max_window_blocks: usize,
pub max_decoded_block_bytes: u64,
pub max_concurrent_reads: usize,
pub read_limiter: Option<Arc<Semaphore>>,
pub max_decode_tasks: usize,
pub source_id: String,
pub block_cache: Arc<BlockCache>,
pub cpu_limiter: Option<CpuLimiter>,
pub prefetch_ring: u8,
/* private fields */
}Expand description
Runtime limits for a CogReader.
max_decode_tasks caps concurrent CPU-heavy decode/stitch jobs submitted
through spawn_blocking. Waiting for a permit is async, so excess requests
yield the Tokio worker instead of flooding the blocking pool.
#[non_exhaustive]: construct with ReaderConfig::default() and assign
fields (or use struct-update syntax inside this crate). This lets new fields
be added without breaking external callers.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.max_ifds: usizeMaximum IFDs accepted before upstream allocations; defaults to 256.
max_ifd_entries: u64Maximum directory entries per IFD before upstream allocations; defaults to 4096. A zero limit rejects nonempty directories.
snapshot_policy: SnapshotPolicyStrong validator required for managed sources by default. Opaque ObjectReader handles require explicit AssumeImmutable.
max_metadata_bytes: u64Maximum cumulative metadata bytes fetched while opening (default: 8 MiB).
work_budget: WorkBudgetShared active-work byte allowance; completed caller-owned images and resident caches have separate ownership/budgets.
max_window_pixels: u64Maximum pixels in a single source window (default: 16 million).
max_window_bytes: u64Maximum declared window data plus mask bytes, and compressed bytes per fetch batch (default: 256 MiB).
max_window_blocks: usizeMaximum blocks requested by one window (default: 4096).
max_decoded_block_bytes: u64Maximum declared uncompressed bytes in any TIFF block (default: 64 MiB).
max_concurrent_reads: usizeConcurrent foreground windows per reader (default: 8), clamped to
1..=tokio::sync::Semaphore::MAX_PERMITS.
read_limiter: Option<Arc<Semaphore>>Optional shared foreground read limiter, e.g. across a mosaic pool.
max_decode_tasks: usizeCapacity of the reader’s CPU limiter when cpu_limiter is None.
Defaults to available parallelism (four if unavailable), clamped to
1..=tokio::sync::Semaphore::MAX_PERMITS. Ignored for an injected limiter.
source_id: StringCaller-supplied id for this logical source (same id ⇒ shared blocks).
block_cache: Arc<BlockCache>Shared decoded-block cache injected by the caller.
cpu_limiter: Option<CpuLimiter>Shared CPU-job limiter. When None, the reader builds its own sized to
max_decode_tasks. Inject the same CpuLimiter into several readers
(and their Tilers) to bound the whole process/mosaic
to one CPU budget — see crate::blocking::CpuLimiter.
prefetch_ring: u8Speculative block prefetch radius, in native COG blocks. After each
read_window, the blocks in a ring of this width around the window
are fetched + decoded into the shared block cache in the background —
map-browsing patterns make those exactly the blocks the neighbouring
XYZ tiles need next, turning their cold misses into warm hits.
0 (the default) disables prefetch. Each ring step issues extra
object-store GETs, so leave it off for pay-per-request storage unless
the latency win is worth it; 1 is the sweet spot for tile serving.
Trait Implementations§
Source§impl Clone for ReaderConfig
impl Clone for ReaderConfig
Auto Trait Implementations§
impl !RefUnwindSafe for ReaderConfig
impl !UnwindSafe for ReaderConfig
impl Freeze for ReaderConfig
impl Send for ReaderConfig
impl Sync for ReaderConfig
impl Unpin for ReaderConfig
impl UnsafeUnpin for ReaderConfig
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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 more