MCPcopy Create free account
hub / github.com/clockworklabs/SpacetimeDB / with_mut_schema

Method with_mut_schema

crates/table/src/table.rs:1403–1405  ·  view source on GitHub ↗

Runs a mutation on the [`TableSchema`] of this table. This uses a clone-on-write mechanism. If none but `self` refers to the schema, then the mutation will be in-place. Otherwise, the schema must be cloned, mutated, and then the cloned version is written back to the table.

(&mut self, with: impl FnOnce(&mut TableSchema) -> R)

Source from the content-addressed store, hash-verified

1401 /// Otherwise, the schema must be cloned, mutated,
1402 /// and then the cloned version is written back to the table.
1403 pub fn with_mut_schema<R>(&mut self, with: impl FnOnce(&mut TableSchema) -> R) -> R {
1404 with(Arc::make_mut(&mut self.schema))
1405 }
1406
1407 /// Runs a mutation on the [`TableSchema`] of this table
1408 /// and then sets the schema of `other` to that of `self`.

Calls

no outgoing calls

Tested by

no test coverage detected