pub fn folder_mut(&mut self, mut path: &[LayerId]) -> Result<&mut Folder, DocumentError> {
		let mut root = if self.is_mounted(self.work_mount_path.as_slice(), path) {
			path = &path[self.work_mount_path.len()..];
			&mut self.work
		} else {
			&mut self.root
		};
		for id in path {
			root = root.folder_mut(*id).ok_or(DocumentError::LayerNotFound)?;
		}
		Ok(root)
	}
/// Returns a mutable reference to the requested folder. Fails if the path does not exist,
/// or if the requested layer is not of type folder.
/// This function respects mounted folders and will thus not contain the layers already
/// present in the document if a temporary folder is mounted on top.
/// If you manually edit the folder you have to set the cache_dirty flag yourself.
Returns a mutable reference to the requested folder. Fails if the path does not exist,
or if the requested layer is not of type folder.
This function respects mounted folders and will thus not contain the layers already
present in the document if a temporary folder is mounted on top.
If you manually edit the folder you have to set the cache_dirty flag yourself.
Returns a mutable reference to the requested folder . Fails if the path does not exist or if the requested layer is not of type folder . This function respects mounted folders and will thus not contain the layers already present in the document if a temporary folder is mounted on top . If you manually edit the folder you have to set the cache_dirty flag yourself .
pub fn folder_mut(&mut self, mut path: &[LayerId]) -> Result<&mut Folder, DocumentError> {
		let mut root = if self.is_mounted(self.work_mount_path.as_slice(), path) {
			path = &path[self.work_mount_path.len()..];
			&mut self.work
		} else {
			&mut self.root
		};
		for id in path {
			root = root.folder_mut(*id).ok_or(DocumentError::LayerNotFound)?;
		}
		Ok(root)
	}
pub fn folder_mut ( & mut self , mut path : & [ LayerId ] ) -> Result < & mut Folder , DocumentError > { let mut root = if self . is_mounted ( self . work_mount_path . as_slice ( ) , path ) { path = & path [ self . work_mount_path . len ( ) .. ] ; & mut self . work } else { & mut self . root } ; for id in path { root = root . folder_mut ( * id ) . ok_or ( DocumentError :: LayerNotFound ) ? ; } Ok ( root ) }
Returns a mutable reference to the requested folder.
Returns a mutable reference to the requested folder .
&mut self
path
&[LayerId]