pub struct NotificationManager {
pub dropped_total: AtomicU64,
/* private fields */
}Expand description
In-memory manager of per-bucket notification configurations.
The dropped_total counter is exposed publicly for the metrics layer to
poll without taking the configuration lock.
Fields§
§dropped_total: AtomicU64Bumped by dispatch_event whenever a destination returns 5xx after
the configured retry budget, or when an aws-events-gated
destination fires without the feature compiled in.
Implementations§
Source§impl NotificationManager
impl NotificationManager
Sourcepub fn put(&self, bucket: &str, config: NotificationConfig)
pub fn put(&self, bucket: &str, config: NotificationConfig)
put_bucket_notification_configuration handler entry. The bucket’s
existing configuration is fully replaced (S3 spec — PutBucket… is
upsert-style at the bucket scope, not per-rule patch).
Sourcepub fn get(&self, bucket: &str) -> Option<NotificationConfig>
pub fn get(&self, bucket: &str) -> Option<NotificationConfig>
get_bucket_notification_configuration handler entry. Returns the
cloned configuration, or None when nothing is registered. AWS S3
returns an empty configuration document (not 404) in that case; the
service-layer handler maps None → empty DTO accordingly.
Sourcepub fn to_json(&self) -> Result<String, Error>
pub fn to_json(&self) -> Result<String, Error>
Serialise the entire manager state to JSON (for
--notifications-state-file snapshot dumps).
Sourcepub fn from_json(s: &str) -> Result<Self, Error>
pub fn from_json(s: &str) -> Result<Self, Error>
Restore a manager from a previously-emitted snapshot. The
dropped_total counter is reset to 0 — historical drops are not
persisted (they’re a runtime metric, not configuration).
Sourcepub fn match_destinations(
&self,
bucket: &str,
event: &EventType,
key: &str,
) -> Vec<Destination>
pub fn match_destinations( &self, bucket: &str, event: &EventType, key: &str, ) -> Vec<Destination>
Match an event against the bucket’s rules and return every destination whose rule accepts the (event type, key) tuple. Order follows the rule declaration order so a deterministic dispatch sequence falls out for tests.
Trait Implementations§
Source§impl Debug for NotificationManager
impl Debug for NotificationManager
Auto Trait Implementations§
impl !Freeze for NotificationManager
impl RefUnwindSafe for NotificationManager
impl Send for NotificationManager
impl Sync for NotificationManager
impl Unpin for NotificationManager
impl UnsafeUnpin for NotificationManager
impl UnwindSafe for NotificationManager
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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>
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>
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