pub struct BucketNotificationConfig {
pub region: String,
pub rules: RulesMap,
}Expand description
Configuration for bucket notifications. This struct now holds the parsed and validated rules in the new RulesMap format.
Fields§
§region: String§rules: RulesMapImplementations§
Source§impl BucketNotificationConfig
impl BucketNotificationConfig
pub fn new(region: &str) -> Self
Sourcepub fn add_rule(
&mut self,
event_names: &[EventName],
pattern: String,
target_id: TargetID,
)
pub fn add_rule( &mut self, event_names: &[EventName], pattern: String, target_id: TargetID, )
Adds a rule to the configuration. This method allows adding a rule with a specific event and target ID.
Sourcepub fn from_xml<R: Read + BufRead>(
reader: R,
current_region: &str,
arn_list: &[String],
) -> Result<Self, BucketNotificationConfigError>
pub fn from_xml<R: Read + BufRead>( reader: R, current_region: &str, arn_list: &[String], ) -> Result<Self, BucketNotificationConfigError>
Parses notification configuration from XML.
arn_list is a list of valid ARN strings for validation.
Sourcepub fn validate(
&self,
current_region: &str,
arn_list: &[String],
) -> Result<(), BucketNotificationConfigError>
pub fn validate( &self, current_region: &str, arn_list: &[String], ) -> Result<(), BucketNotificationConfigError>
Validates the current BucketNotificationConfig.
This might be redundant if construction always implies validation.
However, Go’s Config has a Validate method.
The primary validation now happens during from_xml via NotificationConfiguration::validate.
This method could re-check against an updated arn_list or region if needed.
pub fn get_rules_map(&self) -> &RulesMap
Sourcepub fn set_region(&mut self, region: &str)
pub fn set_region(&mut self, region: &str)
Sets the region for the configuration
Sourcepub fn compile_snapshot(&self) -> BucketRulesSnapshot<DynRulesContainer>
pub fn compile_snapshot(&self) -> BucketRulesSnapshot<DynRulesContainer>
Compiles the current BucketNotificationConfig into a BucketRulesSnapshot. This involves transforming the rules into a format suitable for runtime use, and calculating the event mask based on the subscribed events of the rules.
§Returns
A BucketRulesSnapshot containing the compiled rules and event mask.
Trait Implementations§
Source§impl Clone for BucketNotificationConfig
impl Clone for BucketNotificationConfig
Source§fn clone(&self) -> BucketNotificationConfig
fn clone(&self) -> BucketNotificationConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for BucketNotificationConfig
impl Debug for BucketNotificationConfig
Source§impl Default for BucketNotificationConfig
impl Default for BucketNotificationConfig
Source§fn default() -> BucketNotificationConfig
fn default() -> BucketNotificationConfig
Source§impl<'de> Deserialize<'de> for BucketNotificationConfig
impl<'de> Deserialize<'de> for BucketNotificationConfig
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Auto Trait Implementations§
impl Freeze for BucketNotificationConfig
impl RefUnwindSafe for BucketNotificationConfig
impl Send for BucketNotificationConfig
impl Sync for BucketNotificationConfig
impl Unpin for BucketNotificationConfig
impl UnsafeUnpin for BucketNotificationConfig
impl UnwindSafe for BucketNotificationConfig
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
Source§fn with_current_context(self) -> WithContext<Self> ⓘ
fn with_current_context(self) -> WithContext<Self> ⓘ
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 moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request