pub struct ServerStateBuilder { /* private fields */ }Expand description
Builder for ServerState.
Implementations§
Source§impl ServerStateBuilder
impl ServerStateBuilder
Sourcepub fn storage(self, storage: impl StorageBackend) -> Self
pub fn storage(self, storage: impl StorageBackend) -> Self
Required: the storage backend.
Sourcepub fn verifier(self, verifier: impl TokenVerifier) -> Self
pub fn verifier(self, verifier: impl TokenVerifier) -> Self
Required: the token verifier.
Sourcepub fn validator(self, validator: impl Validator) -> Self
pub fn validator(self, validator: impl Validator) -> Self
Required: the path/permission validator.
Sourcepub fn path_codec(self, codec: impl PathCodec) -> Self
pub fn path_codec(self, codec: impl PathCodec) -> Self
Path translator between real storage paths and client-visible shadow paths (default: identity — no translation).
Handlers resolve inbound shadow paths through
ServerState::resolve_client_path (which also authorizes the
real path) and encode outbound paths via
ServerState::expose_path. See MountPathCodec for readable
aliases and [EncryptedPathCodec] for opaque encrypted paths
(libfw-core/path-encrypt feature).
Sourcepub fn compression(self, format: CompressionFormat) -> Self
pub fn compression(self, format: CompressionFormat) -> Self
Compression for downloads (default: Zrip).
Sourcepub fn max_upload_size(self, size: u64) -> Self
pub fn max_upload_size(self, size: u64) -> Self
Maximum upload size in bytes (default: 100 GiB).
Sourcepub fn limits(self, limits: Limits) -> Self
pub fn limits(self, limits: Limits) -> Self
Tuning-parameter ranges advertised at GET /capabilities.
None (default) exports the libfw built-in defaults. The server
never hard-enforces these beyond existing caps (frame size, upload
body limit); they are an advisory contract for adaptive clients.
Sourcepub fn zrip_levels(self, levels: ZripLevels) -> Self
pub fn zrip_levels(self, levels: ZripLevels) -> Self
Zrip level range for downloads: validates/clamps the
x-libfw-compress-level request header and echoes the actual level.
None (default) keeps the legacy behavior — the header is ignored
and every zrip download uses [ZRIP_DEFAULT_LEVEL].
Sourcepub fn cleanup_interval(self, interval: Duration) -> Self
pub fn cleanup_interval(self, interval: Duration) -> Self
Sweep period of the stale session-temp cleaner (default: 1 hour;
Duration::ZERO disables the sweeper).
Sourcepub fn session_ttl(self, ttl: Duration) -> Self
pub fn session_ttl(self, ttl: Duration) -> Self
Max age of an abandoned session upload temp before removal
(default: 24 hours, DEFAULT_SESSION_TTL).
Sourcepub fn build(self) -> ServerState
pub fn build(self) -> ServerState
Build the state, panicking if required fields are missing.