pub struct TenantDataTransaction<'a> { /* private fields */ }Expand description
The application view of a tenant transaction.
This type intentionally exposes no raw transaction handle, commit operation, or option setters. Every key-bearing operation takes a validated data key or range so application callbacks cannot modify kit metadata.
Implementations§
Source§impl<'a> TenantDataTransaction<'a>
impl<'a> TenantDataTransaction<'a>
Sourcepub fn set_size_limit(&self, limit: TenantTransactionSizeLimit) -> FdbResult<()>
pub fn set_size_limit(&self, limit: TenantTransactionSizeLimit) -> FdbResult<()>
Applies a validated cluster-side size ceiling before application operations.
Sourcepub async fn get(
&self,
key: TenantDataKey<'_>,
snapshot: bool,
) -> FdbResult<Option<FdbSlice>>
pub async fn get( &self, key: TenantDataKey<'_>, snapshot: bool, ) -> FdbResult<Option<FdbSlice>>
Reads an application key, preserving FoundationDB’s retryable error.
Sourcepub fn set(
&self,
key: TenantDataKey<'_>,
value: &[u8],
) -> Result<(), TenantDataAccessErrorReason>
pub fn set( &self, key: TenantDataKey<'_>, value: &[u8], ) -> Result<(), TenantDataAccessErrorReason>
Writes a bounded value under an application key.
Sourcepub fn clear(&self, key: TenantDataKey<'_>)
pub fn clear(&self, key: TenantDataKey<'_>)
Removes one application key. A read-policy attempt aborts the enclosing transaction even though this compatibility method returns no result.
Sourcepub fn try_clear(
&self,
key: TenantDataKey<'_>,
) -> Result<(), TenantDataAccessErrorReason>
pub fn try_clear( &self, key: TenantDataKey<'_>, ) -> Result<(), TenantDataAccessErrorReason>
Checks the write policy before removing one application key.
Sourcepub fn clear_range(&self, range: &TenantDataRange<'_>)
pub fn clear_range(&self, range: &TenantDataRange<'_>)
Removes only the validated application interval. A read-policy attempt aborts the enclosing transaction even though this method returns no result.
Sourcepub fn try_clear_range(
&self,
range: &TenantDataRange<'_>,
) -> Result<(), TenantDataAccessErrorReason>
pub fn try_clear_range( &self, range: &TenantDataRange<'_>, ) -> Result<(), TenantDataAccessErrorReason>
Checks the write policy before clearing an application interval.
Sourcepub fn atomic_op(
&self,
key: TenantDataKey<'_>,
parameter: &[u8],
mutation: MutationType,
) -> Result<(), TenantDataAccessErrorReason>
pub fn atomic_op( &self, key: TenantDataKey<'_>, parameter: &[u8], mutation: MutationType, ) -> Result<(), TenantDataAccessErrorReason>
Applies an atomic mutation to an application key.
Sourcepub fn set_versionstamped_key(
&self,
key_template: &[u8],
value: &[u8],
) -> Result<(), TenantDataAccessErrorReason>
pub fn set_versionstamped_key( &self, key_template: &[u8], value: &[u8], ) -> Result<(), TenantDataAccessErrorReason>
Writes a tuple-layer versionstamped key whose stable prefix is tenant data.
The incomplete versionstamp must lie after the first six key bytes so commit-time substitution cannot move a key into kit metadata or system space.
Sourcepub async fn get_range(
&self,
range: &TenantDataRange<'_>,
limit: TenantDataRangeLimit,
snapshot: bool,
) -> FdbResult<FdbValues>
pub async fn get_range( &self, range: &TenantDataRange<'_>, limit: TenantDataRangeLimit, snapshot: bool, ) -> FdbResult<FdbValues>
Reads one bounded page from an application range.
Sourcepub async fn get_range_with_target(
&self,
range: &TenantDataRange<'_>,
limit: TenantDataRangeLimit,
target_bytes: TenantDataRangeTargetBytes,
snapshot: bool,
) -> FdbResult<FdbValues>
pub async fn get_range_with_target( &self, range: &TenantDataRange<'_>, limit: TenantDataRangeLimit, target_bytes: TenantDataRangeTargetBytes, snapshot: bool, ) -> FdbResult<FdbValues>
Reads a bounded page with an application-selected response byte target.