pub struct DiskConfig { /* private fields */ }Expand description
One named disk’s declaration inside a FilesystemConfig - a root
path and, for a publicly-served disk, the URL prefix files under it
are reachable at. Built with DiskConfig::private/DiskConfig::public
rather than a struct literal, mirroring local()/public()’s own
private-vs-served distinction (url_prefix: None vs Some(..)) so a
config-declared disk can’t accidentally end up in a state neither of
the two built-in disks can.
Implementations§
Source§impl DiskConfig
impl DiskConfig
Sourcepub fn private(root: impl Into<PathBuf>) -> DiskConfig
pub fn private(root: impl Into<PathBuf>) -> DiskConfig
A disk with no URL at all - Disk::url() always returns None,
the same as local().
Sourcepub fn public(
root: impl Into<PathBuf>,
url_prefix: impl Into<String>,
) -> DiskConfig
pub fn public( root: impl Into<PathBuf>, url_prefix: impl Into<String>, ) -> DiskConfig
A disk served at url_prefix - the same shape public() gives
you for public/ itself, for a different root your app also
serves (e.g. a CDN-fronted directory, or a second ServeDir your
own routes/web.rs registers).
Auto Trait Implementations§
impl Forget for DiskConfig
impl Freeze for DiskConfig
impl RefUnwindSafe for DiskConfig
impl Send for DiskConfig
impl Sync for DiskConfig
impl Unpin for DiskConfig
impl UnsafeUnpin for DiskConfig
impl UnwindSafe for DiskConfig
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
impl<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
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> ⓘ
Converts
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> ⓘ
Converts
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