pub struct EmitterBuilder { /* private fields */ }Expand description
Builder for creating emitters with custom configurations.
Implementations§
Source§impl EmitterBuilder
impl EmitterBuilder
Sourcepub fn new(config: &PhyTraceConfig) -> Self
pub fn new(config: &PhyTraceConfig) -> Self
Create a new emitter builder.
Sourcepub fn with_channel(self, tx: Sender<UdmEvent>) -> Self
pub fn with_channel(self, tx: Sender<UdmEvent>) -> Self
Set the event channel sender.
Sourcepub fn with_callback<F>(self, callback: F) -> Self
pub fn with_callback<F>(self, callback: F) -> Self
Set the state callback.
Sourcepub fn with_interval(self, interval: Duration) -> Self
pub fn with_interval(self, interval: Duration) -> Self
Set the emission interval.
Sourcepub fn build(self) -> (PeriodicEmitter, Receiver<UdmEvent>)
pub fn build(self) -> (PeriodicEmitter, Receiver<UdmEvent>)
Build the emitter.
Returns the emitter and a receiver for events.
Sourcepub fn build_with_sender(self, tx: Sender<UdmEvent>) -> PeriodicEmitter
pub fn build_with_sender(self, tx: Sender<UdmEvent>) -> PeriodicEmitter
Build with an existing channel.
Auto Trait Implementations§
impl Freeze for EmitterBuilder
impl !RefUnwindSafe for EmitterBuilder
impl Send for EmitterBuilder
impl Sync for EmitterBuilder
impl Unpin for EmitterBuilder
impl !UnwindSafe for EmitterBuilder
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