pub struct StaticServiceBuilder { /* private fields */ }Expand description
Builder for a confined static service.
Implementations§
Source§impl StaticServiceBuilder
impl StaticServiceBuilder
Sourcepub fn policy(self, policy: StaticPolicy) -> Self
pub fn policy(self, policy: StaticPolicy) -> Self
Set the static-file security policy.
Sourcepub fn default_content_type(self, content_type: impl Into<String>) -> Self
pub fn default_content_type(self, content_type: impl Into<String>) -> Self
Set the fallback type used when a file extension has no known MIME type.
Sourcepub fn extra_response_headers(self, headers: Vec<(String, String)>) -> Self
pub fn extra_response_headers(self, headers: Vec<(String, String)>) -> Self
Set ordered, duplicate-preserving headers for successful static 200 responses.
Sourcepub fn build(self) -> Result<StaticService, ServiceError>
pub fn build(self) -> Result<StaticService, ServiceError>
Build the service and pin its root exactly once.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for StaticServiceBuilder
impl RefUnwindSafe for StaticServiceBuilder
impl Send for StaticServiceBuilder
impl Sync for StaticServiceBuilder
impl Unpin for StaticServiceBuilder
impl UnsafeUnpin for StaticServiceBuilder
impl UnwindSafe for StaticServiceBuilder
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
Mutably borrows from an owned value. Read more