pub struct ObjectLockState {
pub mode: Option<LockMode>,
pub retain_until: Option<DateTime<Utc>>,
pub legal_hold_on: bool,
}Expand description
Per-object lock state. All fields are optional so a “legal hold only”
state (mode = None, retain_until = None, legal_hold_on = true) is
representable, matching S3 semantics where a legal hold can exist without
any retention.
Fields§
§mode: Option<LockMode>§retain_until: Option<DateTime<Utc>>§legal_hold_on: boolImplementations§
Source§impl ObjectLockState
impl ObjectLockState
Sourcepub fn is_locked(&self, now: DateTime<Utc>) -> bool
pub fn is_locked(&self, now: DateTime<Utc>) -> bool
true when the object is presently locked from delete / overwrite.
Legal hold flips this regardless of the retention clock; otherwise
mode + retain_until is what gates.
Sourcepub fn can_delete(&self, now: DateTime<Utc>, bypass_governance: bool) -> bool
pub fn can_delete(&self, now: DateTime<Utc>, bypass_governance: bool) -> bool
true when the caller is permitted to DELETE / overwrite the object.
- Legal hold ON → always denied (cannot be bypassed).
- Compliance + future retain → always denied (cannot be bypassed).
- Governance + future retain +
bypass_governance == true→ allowed. - Governance + future retain +
bypass_governance == false→ denied. - No mode, no retain, no legal hold → allowed.
- retain_until in the past → allowed (lock expired).
Trait Implementations§
Source§impl Clone for ObjectLockState
impl Clone for ObjectLockState
Source§fn clone(&self) -> ObjectLockState
fn clone(&self) -> ObjectLockState
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 moreSource§impl Debug for ObjectLockState
impl Debug for ObjectLockState
Source§impl Default for ObjectLockState
impl Default for ObjectLockState
Source§fn default() -> ObjectLockState
fn default() -> ObjectLockState
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for ObjectLockState
impl<'de> Deserialize<'de> for ObjectLockState
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>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for ObjectLockState
impl PartialEq for ObjectLockState
Source§fn eq(&self, other: &ObjectLockState) -> bool
fn eq(&self, other: &ObjectLockState) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for ObjectLockState
impl Serialize for ObjectLockState
impl Eq for ObjectLockState
impl StructuralPartialEq for ObjectLockState
Auto Trait Implementations§
impl Freeze for ObjectLockState
impl RefUnwindSafe for ObjectLockState
impl Send for ObjectLockState
impl Sync for ObjectLockState
impl Unpin for ObjectLockState
impl UnsafeUnpin for ObjectLockState
impl UnwindSafe for ObjectLockState
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.