pub struct EventWriter { /* private fields */ }Expand description
Translate an AgentEvent into structured SQL rows.
Cheap to clone (DbPool is internally Arc’d); share via Arc<EventWriter>.
Implementations§
Source§impl EventWriter
impl EventWriter
pub fn new(pool: DbPool) -> Self
pub fn pool(&self) -> &DbPool
Sourcepub async fn write_event(&self, event: &AgentEvent) -> StorageResult<()>
pub async fn write_event(&self, event: &AgentEvent) -> StorageResult<()>
Process one AgentEvent. Failures are returned to the caller (the
forwarder logs and continues) so that a transient SQL hiccup does not
poison the rest of the run’s events.
Trait Implementations§
Source§impl Clone for EventWriter
impl Clone for EventWriter
Source§fn clone(&self) -> EventWriter
fn clone(&self) -> EventWriter
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl !RefUnwindSafe for EventWriter
impl !UnwindSafe for EventWriter
impl Freeze for EventWriter
impl Send for EventWriter
impl Sync for EventWriter
impl Unpin for EventWriter
impl UnsafeUnpin for EventWriter
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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