pub trait WritableValueSet: ValueSet {
// Required methods
fn insert_value<'life0, 'life1, 'async_trait>(
&'life0 self,
id: impl Into<Self::Id> + Send + 'async_trait,
record: &'life1 Record<Self::Value>,
) -> Pin<Box<dyn Future<Output = Result<Record<Self::Value>, VantageError>> + Send + 'async_trait>>
where 'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait;
fn replace_value<'life0, 'life1, 'async_trait>(
&'life0 self,
id: impl Into<Self::Id> + Send + 'async_trait,
record: &'life1 Record<Self::Value>,
) -> Pin<Box<dyn Future<Output = Result<Record<Self::Value>, VantageError>> + Send + 'async_trait>>
where 'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait;
fn patch_value<'life0, 'life1, 'async_trait>(
&'life0 self,
id: impl Into<Self::Id> + Send + 'async_trait,
partial: &'life1 Record<Self::Value>,
) -> Pin<Box<dyn Future<Output = Result<Record<Self::Value>, VantageError>> + Send + 'async_trait>>
where 'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait;
fn delete<'life0, 'async_trait>(
&'life0 self,
id: impl Into<Self::Id> + Send + 'async_trait,
) -> Pin<Box<dyn Future<Output = Result<(), VantageError>> + Send + 'async_trait>>
where 'life0: 'async_trait,
Self: 'async_trait;
fn delete_all<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<(), VantageError>> + Send + 'async_trait>>
where 'life0: 'async_trait,
Self: 'async_trait;
}Expand description
Write operations on raw storage values with idempotent behavior.
See documentation for ValueSet for implementation example.
Required Methods§
Sourcefn insert_value<'life0, 'life1, 'async_trait>(
&'life0 self,
id: impl Into<Self::Id> + Send + 'async_trait,
record: &'life1 Record<Self::Value>,
) -> Pin<Box<dyn Future<Output = Result<Record<Self::Value>, VantageError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
fn insert_value<'life0, 'life1, 'async_trait>(
&'life0 self,
id: impl Into<Self::Id> + Send + 'async_trait,
record: &'life1 Record<Self::Value>,
) -> Pin<Box<dyn Future<Output = Result<Record<Self::Value>, VantageError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
Insert value with a specific ID (often generated) (HTTP POST with ID)
Idempotent: Succeeds if no record exists with the given ID. If record already exists, must return success without overwriting data, returning original data.
Returns: Record as it was stored.
§Use Case
Generate unique ID and store record while avoiding duplicates.
Sourcefn replace_value<'life0, 'life1, 'async_trait>(
&'life0 self,
id: impl Into<Self::Id> + Send + 'async_trait,
record: &'life1 Record<Self::Value>,
) -> Pin<Box<dyn Future<Output = Result<Record<Self::Value>, VantageError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
fn replace_value<'life0, 'life1, 'async_trait>(
&'life0 self,
id: impl Into<Self::Id> + Send + 'async_trait,
record: &'life1 Record<Self::Value>,
) -> Pin<Box<dyn Future<Output = Result<Record<Self::Value>, VantageError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
Replace the entire record at the specified ID (HTTP PUT)
Idempotent: Always succeeds, completely overwrites existing data
if present. If possible, will remove/recreate record; therefore if
record doesn’t contain certain attributes which were present in the
database, those will be removed. If record does not exist, will
create it.
Returns: Record as it was stored.
§Use Case
Replace with a new version of a record.
Sourcefn patch_value<'life0, 'life1, 'async_trait>(
&'life0 self,
id: impl Into<Self::Id> + Send + 'async_trait,
partial: &'life1 Record<Self::Value>,
) -> Pin<Box<dyn Future<Output = Result<Record<Self::Value>, VantageError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
fn patch_value<'life0, 'life1, 'async_trait>(
&'life0 self,
id: impl Into<Self::Id> + Send + 'async_trait,
partial: &'life1 Record<Self::Value>,
) -> Pin<Box<dyn Future<Output = Result<Record<Self::Value>, VantageError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
Partially update a record by merging with the provided value (HTTP PATCH)
Fails if record doesn’t exist. The exact merge behavior depends on the storage implementation - typically merges object fields for JSON-like values.
Returns: Record as it was stored (not only the partial change).
§Use Case
Update only the modified fields of a record.
Sourcefn delete<'life0, 'async_trait>(
&'life0 self,
id: impl Into<Self::Id> + Send + 'async_trait,
) -> Pin<Box<dyn Future<Output = Result<(), VantageError>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
fn delete<'life0, 'async_trait>(
&'life0 self,
id: impl Into<Self::Id> + Send + 'async_trait,
) -> Pin<Box<dyn Future<Output = Result<(), VantageError>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
Delete a record by ID (HTTP DELETE)
Idempotent: Always succeeds, even if the record doesn’t exist. This allows safe cleanup operations without checking existence first.
Sourcefn delete_all<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<(), VantageError>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
fn delete_all<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<(), VantageError>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
Delete all records in the set (HTTP DELETE without ID)
Idempotent: All records in the set will be deleted. Executing several times is OK.
Execute on a subset of your entire database.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".
Implementations on Foreign Types§
Source§impl WritableValueSet for Vista
Every write drops the record’s computed columns before the backend sees it.
impl WritableValueSet for Vista
Every write drops the record’s computed columns before the backend sees it.