Struct time::ServerBuilder
source · pub struct ServerBuilder { /* private fields */ }Expand description
Convenient builder that helps you to build a Server.
Implementations§
source§impl ServerBuilder
impl ServerBuilder
pub fn new() -> Self
pub fn with_server_config(self, config: ServerConfig) -> Self
pub fn with_timer_config(self, config: TimerConfig) -> Self
sourcepub fn with_pomodoro_config(self) -> Self
pub fn with_pomodoro_config(self) -> Self
Configures 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.
https://en.wikipedia.org/wiki/Pomodoro_Technique
sourcepub fn with_52_17_config(self) -> Self
pub fn with_52_17_config(self) -> Self
Configures the timer to follow the 52/17 time management method, which alternates 52 min of work and 17 min of resting.
https://en.wikipedia.org/wiki/52/17_rule
pub fn with_server_handler<H>(self, handler: H) -> Selfwhere H: Fn(ServerEvent) -> Result<()> + Sync + Send + 'static,
pub fn with_binder(self, binder: Box<dyn ServerBind>) -> Self
pub fn with_timer_handler<H>(self, handler: H) -> Selfwhere H: Fn(TimerEvent) -> Result<()> + Sync + Send + 'static,
pub fn with_cycle<C>(self, cycle: C) -> Selfwhere C: Into<TimerCycle>,
pub fn with_cycles<C, I>(self, cycles: I) -> Selfwhere C: Into<TimerCycle>, I: IntoIterator<Item = C>,
pub fn with_cycles_count(self, count: impl Into<TimerLoop>) -> Self
pub fn build(self) -> Result<Server>
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