Function replace_child_with_object

Source
pub async fn replace_child_with_object<'a, S: HandleOwner>(
    transaction: &mut Transaction<'a>,
    src: Option<(u64, ObjectDescriptor)>,
    dst: (&'a Directory<S>, &str),
    sub_dirs_delta: i64,
    timestamp: Timestamp,
) -> Result<ReplacedChild, Error>
Expand description

Replaces dst.0/dst.1 with the given object, or unlinks if src is None.

If |dst.0| already has a child |dst.1|, it is removed from dst.0. For files, if this was their last reference, the file is moved to the graveyard. For directories, the removed directory will be moved to the graveyard (and must be empty). The caller is responsible for tombstoning files (when it is no longer open) and directories (immediately after committing the transaction).

sub_dirs_delta can be used if src is a directory and happened to already be a child of dst.