Skip to main content

ServerStateBuilder

Struct ServerStateBuilder 

Source
pub struct ServerStateBuilder { /* private fields */ }
Expand description

Builder for ServerState.

Implementations§

Source§

impl ServerStateBuilder

Source

pub fn storage(self, storage: impl StorageBackend) -> Self

Required: the storage backend.

Source

pub fn verifier(self, verifier: impl TokenVerifier) -> Self

Required: the token verifier.

Source

pub fn validator(self, validator: impl Validator) -> Self

Required: the path/permission validator.

Source

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).

Source

pub fn compression(self, format: CompressionFormat) -> Self

Compression for downloads (default: Zrip).

Source

pub fn max_upload_size(self, size: u64) -> Self

Maximum upload size in bytes (default: 100 GiB).

Source

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.

Source

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].

Source

pub fn cleanup_interval(self, interval: Duration) -> Self

Sweep period of the stale session-temp cleaner (default: 1 hour; Duration::ZERO disables the sweeper).

Source

pub fn session_ttl(self, ttl: Duration) -> Self

Max age of an abandoned session upload temp before removal (default: 24 hours, DEFAULT_SESSION_TTL).

Source

pub fn build(self) -> ServerState

Build the state, panicking if required fields are missing.

Trait Implementations§

Source§

impl Default for ServerStateBuilder

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<A, B, T> HttpServerConnExec<A, B> for T
where B: Body,

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, S> SimdFrom<T, S> for T
where S: Simd,

Source§

fn simd_from(_simd: S, value: T) -> T

Source§

impl<F, T, S> SimdInto<T, S> for F
where T: SimdFrom<F, S>, S: Simd,

Source§

fn simd_into(self, simd: S) -> T

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more