pub trait ControlStateWriteAccess: Send + Sync {
// Required methods
fn publish_database<'life0, 'life1, 'async_trait>(
&'life0 self,
publisher: &'life1 Identity,
spec: DatabaseDef,
) -> Pin<Box<dyn Future<Output = Result<Option<UpdateDatabaseResult>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn delete_database<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
caller_identity: &'life1 Identity,
database_identity: &'life2 Identity,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait;
fn add_energy<'life0, 'life1, 'async_trait>(
&'life0 self,
identity: &'life1 Identity,
amount: EnergyQuanta,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn withdraw_energy<'life0, 'life1, 'async_trait>(
&'life0 self,
identity: &'life1 Identity,
amount: EnergyQuanta,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn register_tld<'life0, 'life1, 'async_trait>(
&'life0 self,
identity: &'life1 Identity,
tld: Tld,
) -> Pin<Box<dyn Future<Output = Result<RegisterTldResult>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn create_dns_record<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
owner_identity: &'life1 Identity,
domain: &'life2 DomainName,
database_identity: &'life3 Identity,
) -> Pin<Box<dyn Future<Output = Result<InsertDomainResult>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait;
fn replace_dns_records<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
database_identity: &'life1 Identity,
owner_identity: &'life2 Identity,
domain_names: &'life3 [DomainName],
) -> Pin<Box<dyn Future<Output = Result<SetDomainsResult>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait;
}Expand description
Write operations on the SpacetimeDB control plane.
Required Methods§
Sourcefn publish_database<'life0, 'life1, 'async_trait>(
&'life0 self,
publisher: &'life1 Identity,
spec: DatabaseDef,
) -> Pin<Box<dyn Future<Output = Result<Option<UpdateDatabaseResult>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn publish_database<'life0, 'life1, 'async_trait>(
&'life0 self,
publisher: &'life1 Identity,
spec: DatabaseDef,
) -> Pin<Box<dyn Future<Output = Result<Option<UpdateDatabaseResult>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Publish a database acc. to DatabaseDef.
If the database with the given identity was successfully published before,
it is updated acc. to the module lifecycle conventions. Some result is
returned in that case.
Otherwise, None is returned meaning that the database was freshly
initialized.
fn delete_database<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
caller_identity: &'life1 Identity,
database_identity: &'life2 Identity,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn add_energy<'life0, 'life1, 'async_trait>(
&'life0 self,
identity: &'life1 Identity,
amount: EnergyQuanta,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn withdraw_energy<'life0, 'life1, 'async_trait>(
&'life0 self,
identity: &'life1 Identity,
amount: EnergyQuanta,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn register_tld<'life0, 'life1, 'async_trait>(
&'life0 self,
identity: &'life1 Identity,
tld: Tld,
) -> Pin<Box<dyn Future<Output = Result<RegisterTldResult>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn create_dns_record<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
owner_identity: &'life1 Identity,
domain: &'life2 DomainName,
database_identity: &'life3 Identity,
) -> Pin<Box<dyn Future<Output = Result<InsertDomainResult>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
Sourcefn replace_dns_records<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
database_identity: &'life1 Identity,
owner_identity: &'life2 Identity,
domain_names: &'life3 [DomainName],
) -> Pin<Box<dyn Future<Output = Result<SetDomainsResult>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
fn replace_dns_records<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
database_identity: &'life1 Identity,
owner_identity: &'life2 Identity,
domain_names: &'life3 [DomainName],
) -> Pin<Box<dyn Future<Output = Result<SetDomainsResult>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
Replace all dns records pointing to database_identity with domain_names.
All existing names in the database and in domain_names must be
owned by owner_identity (i.e. their TLD must belong to owner_identity).
The owner_identity is typically also the owner of the database.
Note that passing an empty slice is legal, and will just remove any existing dns records.