radicle_cob/object/collaboration/
remove.rs

1// Copyright © 2022 The Radicle Link Contributors
2
3use radicle_crypto::PublicKey;
4
5use crate::{ObjectId, Store, TypeName};
6
7use super::error;
8
9/// Remove a [`crate::CollaborativeObject`].
10///
11/// The `storage` is the backing storage for storing
12/// [`crate::Entry`]s at content-addressable locations. Please see
13/// [`Store`] for further information.
14///
15/// The `typename` is the type of object to be found, while the
16/// `object_id` is the identifier for the particular object under that
17/// type.
18pub fn remove<S>(
19    storage: &S,
20    identifier: &PublicKey,
21    typename: &TypeName,
22    oid: &ObjectId,
23) -> Result<(), error::Remove>
24where
25    S: Store,
26{
27    storage
28        .remove(identifier, typename, oid)
29        .map_err(|e| error::Remove { err: e.into() })?;
30
31    Ok(())
32}