Struct time::server::ServerBuilder
source · pub struct ServerBuilder { /* private fields */ }
Available on crate feature
server
only.Expand description
The server builder.
Convenient builder to help building a final Server
.
Implementations§
source§impl ServerBuilder
impl ServerBuilder
sourcepub fn with_server_config(self, config: ServerConfig) -> Self
pub fn with_server_config(self, config: ServerConfig) -> Self
Set the server configuration.
sourcepub fn with_timer_config(self, config: TimerConfig) -> Self
pub fn with_timer_config(self, config: TimerConfig) -> Self
Set the timer configuration.
sourcepub fn with_pomodoro_config(self) -> Self
pub fn with_pomodoro_config(self) -> Self
Configure the timer to follow the Pomodoro time management method, which alternates 25 min of work and 5 min of breaks 4 times, then ends with a long break of 15 min.
sourcepub fn with_52_17_config(self) -> Self
pub fn with_52_17_config(self) -> Self
Configure the timer to follow the 52/17 time management method, which alternates 52 min of work and 17 min of resting.
sourcepub fn with_server_handler<F: Future<Output = Result<()>> + Send + 'static>(
self,
handler: impl Fn(ServerEvent) -> F + Send + Sync + 'static
) -> Self
pub fn with_server_handler<F: Future<Output = Result<()>> + Send + 'static>( self, handler: impl Fn(ServerEvent) -> F + Send + Sync + 'static ) -> Self
Set the server handler.
sourcepub fn with_binder(self, binder: Box<dyn ServerBind>) -> Self
pub fn with_binder(self, binder: Box<dyn ServerBind>) -> Self
Push the given server binder.
sourcepub fn with_timer_handler<F: Future<Output = Result<()>> + Send + 'static>(
self,
handler: impl Fn(TimerEvent) -> F + Sync + Send + 'static
) -> Self
pub fn with_timer_handler<F: Future<Output = Result<()>> + Send + 'static>( self, handler: impl Fn(TimerEvent) -> F + Sync + Send + 'static ) -> Self
Set the timer handler.
sourcepub fn with_cycle<C>(self, cycle: C) -> Selfwhere
C: Into<TimerCycle>,
pub fn with_cycle<C>(self, cycle: C) -> Selfwhere
C: Into<TimerCycle>,
Push the given timer cycle.
sourcepub fn with_cycles<C, I>(self, cycles: I) -> Self
pub fn with_cycles<C, I>(self, cycles: I) -> Self
Set the timer cycles.
sourcepub fn with_cycles_count(self, count: impl Into<TimerLoop>) -> Self
pub fn with_cycles_count(self, count: impl Into<TimerLoop>) -> Self
Set the timer cycles count.
Trait Implementations§
source§impl Default for ServerBuilder
impl Default for ServerBuilder
source§fn default() -> ServerBuilder
fn default() -> ServerBuilder
Returns the “default value” for a type. Read more
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