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 Freeze for ServerBuilder
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