pub struct AgentEventBuilder<'a> { /* private fields */ }Expand description
Fluent event builder that integrates with the agent.
Implementations§
Source§impl<'a> AgentEventBuilder<'a>
impl<'a> AgentEventBuilder<'a>
Sourcepub fn source_id(self, source_id: impl Into<String>) -> Self
pub fn source_id(self, source_id: impl Into<String>) -> Self
Set the source ID (overrides config default).
Sourcepub fn source_type(self, source_type: SourceType) -> Self
pub fn source_type(self, source_type: SourceType) -> Self
Set the source type (overrides config default).
Sourcepub fn position_2d(self, x: f64, y: f64) -> Self
pub fn position_2d(self, x: f64, y: f64) -> Self
Set 2D position.
Sourcepub fn gps(self, latitude: f64, longitude: f64) -> Self
pub fn gps(self, latitude: f64, longitude: f64) -> Self
Set GPS coordinates (latitude, longitude).
Sourcepub fn position_3d(self, x: f64, y: f64, z: f64) -> Self
pub fn position_3d(self, x: f64, y: f64, z: f64) -> Self
Set 3D position.
Sourcepub fn battery_soc(self, soc_percent: f64) -> Self
pub fn battery_soc(self, soc_percent: f64) -> Self
Set battery state of charge.
Sourcepub fn operational_mode(self, mode: OperationalMode) -> Self
pub fn operational_mode(self, mode: OperationalMode) -> Self
Set operational mode.
Sourcepub fn safety_state(self, state: SafetyState) -> Self
pub fn safety_state(self, state: SafetyState) -> Self
Set safety state.
Sourcepub fn event_type(self, event_type: EventType) -> Self
pub fn event_type(self, event_type: EventType) -> Self
Set event type.
Sourcepub fn extensions(self, extensions: Value) -> Self
pub fn extensions(self, extensions: Value) -> Self
Set extensions.
Sourcepub fn with_builder<F>(self, f: F) -> Self
pub fn with_builder<F>(self, f: F) -> Self
Access the underlying builder for advanced configuration.
Sourcepub async fn send(self) -> PhyTraceResult<()>
pub async fn send(self) -> PhyTraceResult<()>
Build and send the event.
Sourcepub fn build(self) -> PhyTraceResult<UdmEvent>
pub fn build(self) -> PhyTraceResult<UdmEvent>
Build without sending (for inspection or manual sending).
Auto Trait Implementations§
impl<'a> Freeze for AgentEventBuilder<'a>
impl<'a> !RefUnwindSafe for AgentEventBuilder<'a>
impl<'a> Send for AgentEventBuilder<'a>
impl<'a> Sync for AgentEventBuilder<'a>
impl<'a> Unpin for AgentEventBuilder<'a>
impl<'a> !UnwindSafe for AgentEventBuilder<'a>
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