Creates a new trunk (file). Allocates an inode and stores the trunk. # Arguments `id` - The trunk ID `path` - The file path `encoding` - Optional text encoding
(
&mut self,
id: TrunkId,
path: &str,
encoding: Option<Encoding>,
)
| 377 | /// * `path` - The file path |
| 378 | /// * `encoding` - Optional text encoding |
| 379 | fn create_trunk( |
| 380 | &mut self, |
| 381 | id: TrunkId, |
| 382 | path: &str, |
| 383 | encoding: Option<Encoding>, |
| 384 | ) -> Result<Trunk, Self::Error> { |
| 385 | let inode = self.alloc_inode()?; |
| 386 | let trunk = Trunk::new(id, inode, path.to_string(), encoding); |
| 387 | self.put_trunk(&trunk)?; |
| 388 | Ok(trunk) |
| 389 | } |
| 390 | |
| 391 | /// Marks a trunk as deleted. |
| 392 | /// |