pub struct StorageTrigger {
pub function_name: String,
pub bucket: String,
pub operation: StorageOperation,
}Expand description
A trigger that fires after storage operations.
Fields§
§function_name: StringName of the function to invoke.
bucket: StringBucket name to listen on.
operation: StorageOperationOperation filter (Upload, Delete, or Any).
Implementations§
Source§impl StorageTrigger
impl StorageTrigger
Sourcepub fn matches(&self, event: &StorageEventPayload) -> bool
pub fn matches(&self, event: &StorageEventPayload) -> bool
Check if this trigger matches the given storage event.
Matches if:
- Bucket name matches exactly
- Operation matches (Upload/Delete/Any)
- Key doesn’t have
_transforms/prefix (internal cache operations)
Sourcepub fn should_fire(&self, event: &StorageEventPayload) -> bool
pub fn should_fire(&self, event: &StorageEventPayload) -> bool
Check if this trigger should fire for the given event.
This is an explicit check (same as matches but with a different name
for clarity in tests).
Sourcepub fn build_payload(&self, event: &StorageEventPayload) -> EventPayload
pub fn build_payload(&self, event: &StorageEventPayload) -> EventPayload
Build an EventPayload from a storage event.
Trait Implementations§
Source§impl Clone for StorageTrigger
impl Clone for StorageTrigger
Source§fn clone(&self) -> StorageTrigger
fn clone(&self) -> StorageTrigger
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 Freeze for StorageTrigger
impl RefUnwindSafe for StorageTrigger
impl Send for StorageTrigger
impl Sync for StorageTrigger
impl Unpin for StorageTrigger
impl UnsafeUnpin for StorageTrigger
impl UnwindSafe for StorageTrigger
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