pub struct ServeConfig {Show 17 fields
pub s3_uri: Option<String>,
pub host: String,
pub port: u16,
pub s3_bucket: Option<String>,
pub s3_endpoint: Option<String>,
pub s3_region: String,
pub auth_secret: Option<String>,
pub auth_enabled: bool,
pub cache_slides: usize,
pub cache_blocks: usize,
pub cache_tiles: usize,
pub block_size: usize,
pub jpeg_quality: u8,
pub cache_max_age: u32,
pub cors_origins: Option<Vec<String>>,
pub verbose: bool,
pub no_tracing: bool,
}Expand description
Configuration for the serve command (tile server).
Fields§
§s3_uri: Option<String>S3 bucket URI (e.g., s3://my-bucket) or just the bucket name. Alternative to –s3-bucket flag.
host: StringHost address to bind the server to.
port: u16Port to listen on.
s3_bucket: Option<String>S3 bucket name containing the slide files. Can also be provided as a positional argument (s3://bucket).
s3_endpoint: Option<String>Custom S3 endpoint URL for S3-compatible services (MinIO, etc.).
If not specified, uses the default AWS S3 endpoint.
s3_region: StringAWS region for S3.
auth_secret: Option<String>Secret key for HMAC-SHA256 signed URL authentication.
Required when authentication is enabled.
auth_enabled: boolEnable signed URL authentication.
When disabled (default), all tile requests are allowed without authentication. Enable for production deployments.
cache_slides: usizeMaximum number of slides to keep in cache.
cache_blocks: usizeMaximum number of blocks to cache per slide (256KB each).
cache_tiles: usizeMaximum tile cache size in bytes (default: 100MB).
block_size: usizeBlock size in bytes for the block cache.
jpeg_quality: u8Default JPEG quality for tile encoding (1-100).
cache_max_age: u32HTTP Cache-Control max-age in seconds.
cors_origins: Option<Vec<String>>Allowed CORS origins (comma-separated).
If not specified, allows any origin.
verbose: boolEnable verbose logging (debug level).
no_tracing: boolDisable request tracing.
Implementations§
Source§impl ServeConfig
impl ServeConfig
Sourcepub fn resolve_bucket(&self) -> Result<String, String>
pub fn resolve_bucket(&self) -> Result<String, String>
Resolve the S3 bucket name from either the positional URI or –s3-bucket flag.
Sourcepub fn validate(&self) -> Result<(), String>
pub fn validate(&self) -> Result<(), String>
Validate the configuration and return an error message if invalid.
Sourcepub fn bind_address(&self) -> String
pub fn bind_address(&self) -> String
Get the server bind address as “host:port”.
Sourcepub fn auth_secret_or_empty(&self) -> &str
pub fn auth_secret_or_empty(&self) -> &str
Get the auth secret, returning empty string if not set.
Trait Implementations§
Source§impl Args for ServeConfig
impl Args for ServeConfig
Source§fn augment_args<'b>(__clap_app: Command) -> Command
fn augment_args<'b>(__clap_app: Command) -> Command
Source§fn augment_args_for_update<'b>(__clap_app: Command) -> Command
fn augment_args_for_update<'b>(__clap_app: Command) -> Command
Command so it can instantiate self via
FromArgMatches::update_from_arg_matches_mut Read moreSource§impl Clone for ServeConfig
impl Clone for ServeConfig
Source§fn clone(&self) -> ServeConfig
fn clone(&self) -> ServeConfig
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ServeConfig
impl Debug for ServeConfig
Source§impl FromArgMatches for ServeConfig
impl FromArgMatches for ServeConfig
Source§fn from_arg_matches(__clap_arg_matches: &ArgMatches) -> Result<Self, Error>
fn from_arg_matches(__clap_arg_matches: &ArgMatches) -> Result<Self, Error>
Source§fn from_arg_matches_mut(
__clap_arg_matches: &mut ArgMatches,
) -> Result<Self, Error>
fn from_arg_matches_mut( __clap_arg_matches: &mut ArgMatches, ) -> Result<Self, Error>
Source§fn update_from_arg_matches(
&mut self,
__clap_arg_matches: &ArgMatches,
) -> Result<(), Error>
fn update_from_arg_matches( &mut self, __clap_arg_matches: &ArgMatches, ) -> Result<(), Error>
ArgMatches to self.Source§fn update_from_arg_matches_mut(
&mut self,
__clap_arg_matches: &mut ArgMatches,
) -> Result<(), Error>
fn update_from_arg_matches_mut( &mut self, __clap_arg_matches: &mut ArgMatches, ) -> Result<(), Error>
ArgMatches to self.Auto Trait Implementations§
impl Freeze for ServeConfig
impl RefUnwindSafe for ServeConfig
impl Send for ServeConfig
impl Sync for ServeConfig
impl Unpin for ServeConfig
impl UnwindSafe for ServeConfig
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