#[non_exhaustive]pub struct OwnershipRow {
pub id: String,
pub principal_id: PrincipalId,
pub resource_kind: String,
pub resource_id: String,
pub relationship: String,
pub granted_by: PrincipalId,
pub on_behalf_of: Option<PrincipalId>,
pub granted_at: i64,
pub revoked_at: Option<i64>,
}Expand description
One row in the ownership table.
id is an opaque 128-bit identifier (UUIDv4 in the cheers-sqlx impls,
matching the existing mint_user_id shape — the doc spec calls for “ULID”
but the concrete crypto-random 128-bit shape is what’s load-bearing, not
the encoding).
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.id: String§principal_id: PrincipalId§resource_kind: String§resource_id: String§relationship: String§granted_by: PrincipalId§on_behalf_of: Option<PrincipalId>§granted_at: i64§revoked_at: Option<i64>None while the row is live; the unix-second timestamp the soft delete
landed on once revoked. Rows with Some(_) are excluded from
list_for_principal.
Implementations§
Source§impl OwnershipRow
impl OwnershipRow
Sourcepub fn new(
id: String,
principal_id: PrincipalId,
resource_kind: String,
resource_id: String,
relationship: String,
granted_by: PrincipalId,
on_behalf_of: Option<PrincipalId>,
granted_at: i64,
revoked_at: Option<i64>,
) -> Self
pub fn new( id: String, principal_id: PrincipalId, resource_kind: String, resource_id: String, relationship: String, granted_by: PrincipalId, on_behalf_of: Option<PrincipalId>, granted_at: i64, revoked_at: Option<i64>, ) -> Self
Build a row from its constituent fields. Use from OwnershipStore
impls that need to assemble a row from a SQL query result.
Sourcepub fn is_revoked(&self) -> bool
pub fn is_revoked(&self) -> bool
true iff the row has been soft-revoked.
Trait Implementations§
Source§impl Clone for OwnershipRow
impl Clone for OwnershipRow
Source§fn clone(&self) -> OwnershipRow
fn clone(&self) -> OwnershipRow
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 OwnershipRow
impl Debug for OwnershipRow
Source§impl<'de> Deserialize<'de> for OwnershipRow
impl<'de> Deserialize<'de> for OwnershipRow
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
impl Eq for OwnershipRow
Source§impl PartialEq for OwnershipRow
impl PartialEq for OwnershipRow
Source§impl Serialize for OwnershipRow
impl Serialize for OwnershipRow
impl StructuralPartialEq for OwnershipRow
Auto Trait Implementations§
impl Freeze for OwnershipRow
impl RefUnwindSafe for OwnershipRow
impl Send for OwnershipRow
impl Sync for OwnershipRow
impl Unpin for OwnershipRow
impl UnsafeUnpin for OwnershipRow
impl UnwindSafe for OwnershipRow
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