pub struct Options { /* private fields */ }
Expand description
Configuration options for the server.
This struct provides a builder-style API for constructing the desired options.
Examples
use nickel::{Nickel, Options};
let mut server = Nickel::new();
// Don't print to stdout when starting the server
// and force using 8 threads.
server.options = Options::default()
.output_on_listen(false)
.thread_count(Some(8));
Implementations
sourceimpl Options
impl Options
sourcepub fn output_on_listen(self, output: bool) -> Self
pub fn output_on_listen(self, output: bool) -> Self
Whether the server should print the local address it is listening on when starting.
Defaults to true
.
sourcepub fn thread_count(self, thread_count: Option<usize>) -> Self
pub fn thread_count(self, thread_count: Option<usize>) -> Self
The number of threads the server should use or None
to use the
hyper
’s default of 1.25 * core_count
.
Defaults to None
.
sourcepub fn reload_policy(self, reload_policy: ReloadPolicy) -> Self
pub fn reload_policy(self, reload_policy: ReloadPolicy) -> Self
The TemplateCache reload policy. Defaults to ReloadPolicy::Never.
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for Options
impl Send for Options
impl Sync for Options
impl Unpin for Options
impl UnwindSafe for Options
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more