pub struct StatisticsServerBuilder { /* private fields */ }Expand description
Builder for creating a StatisticsServer instance.
Implementations§
Source§impl StatisticsServerBuilder
impl StatisticsServerBuilder
Sourcepub fn address(self, address: impl Into<String>) -> Self
pub fn address(self, address: impl Into<String>) -> Self
Sets the listening address for the statistics server.
Sourcepub fn stats(self, stats: HashMap<String, ClientStats>) -> Self
pub fn stats(self, stats: HashMap<String, ClientStats>) -> Self
Sets the initial statistics.
This is typically loaded from persistent storage (e.g., database) at startup.
Sourcepub fn event_rx(self, event_rx: Receiver<Event>) -> Self
pub fn event_rx(self, event_rx: Receiver<Event>) -> Self
Sets the event receiver the server listens to for tracking events.
Sourcepub fn build(self) -> Result<StatisticsServer, BuilderError>
pub fn build(self) -> Result<StatisticsServer, BuilderError>
Consumes the builder and produces a configured StatisticsServer.
Trait Implementations§
Source§impl Debug for StatisticsServerBuilder
impl Debug for StatisticsServerBuilder
Source§impl Default for StatisticsServerBuilder
impl Default for StatisticsServerBuilder
Source§fn default() -> StatisticsServerBuilder
fn default() -> StatisticsServerBuilder
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for StatisticsServerBuilder
impl RefUnwindSafe for StatisticsServerBuilder
impl Send for StatisticsServerBuilder
impl Sync for StatisticsServerBuilder
impl Unpin for StatisticsServerBuilder
impl UnwindSafe for StatisticsServerBuilder
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> Erasable for T
impl<T> Erasable for T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more