radicle_cob/object/collaboration/
remove.rs

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