Struct file_serve::ServerBuilder
source · pub struct ServerBuilder { /* private fields */ }
Expand description
Custom server settings
Implementations§
source§impl ServerBuilder
impl ServerBuilder
pub fn new(source: impl Into<PathBuf>) -> Self
sourcepub fn port(&mut self, port: u16) -> &mut Self
pub fn port(&mut self, port: u16) -> &mut Self
Override the port
By default, the first available port is selected.
sourcepub fn build(&self) -> Server
pub fn build(&self) -> Server
Create a server
This is needed for accessing the dynamically assigned pot
sourcepub fn serve(&self) -> Result<Infallible, Error>
pub fn serve(&self) -> Result<Infallible, Error>
Start the webserver
Trait Implementations§
source§impl Clone for ServerBuilder
impl Clone for ServerBuilder
source§fn clone(&self) -> ServerBuilder
fn clone(&self) -> ServerBuilder
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for ServerBuilder
impl Debug for ServerBuilder
source§impl PartialEq<ServerBuilder> for ServerBuilder
impl PartialEq<ServerBuilder> for ServerBuilder
source§fn eq(&self, other: &ServerBuilder) -> bool
fn eq(&self, other: &ServerBuilder) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.impl Eq for ServerBuilder
impl StructuralEq for ServerBuilder
impl StructuralPartialEq for ServerBuilder
Auto Trait Implementations§
impl RefUnwindSafe for ServerBuilder
impl Send for ServerBuilder
impl Sync for ServerBuilder
impl Unpin for ServerBuilder
impl UnwindSafe for ServerBuilder
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