MCPcopy Create free account
hub / github.com/AppFlowy-IO/AppFlowy-Collab / insert_block

Method insert_block

collab/src/document/document.rs:239–246  ·  view source on GitHub ↗

Insert block to the document.

(
    &mut self,
    block: Block,
    prev_id: Option<String>,
  )

Source from the content-addressed store, hash-verified

237
238 /// Insert block to the document.
239 pub fn insert_block(
240 &mut self,
241 block: Block,
242 prev_id: Option<String>,
243 ) -> Result<Block, CollabError> {
244 let mut txn = self.collab.transact_mut();
245 self.body.insert_block(&mut txn, block, prev_id)
246 }
247
248 pub fn delete_block(&mut self, block_id: &str) -> Result<(), CollabError> {
249 let mut txn = self.collab.transact_mut();

Calls 3

transact_mutMethod · 0.80
create_block_with_txnMethod · 0.80