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.