Skip to main content

snix_castore/directoryservice/
failing_putter.rs

1use crate::{B3Digest, Directory};
2pub struct FailingPutter;
3
4#[tonic::async_trait]
5impl super::DirectoryPutter for FailingPutter {
6    async fn put(&mut self, _directory: Directory) -> Result<(), super::Error> {
7        Err(Error::Unimplemented)?
8    }
9    async fn close(&mut self) -> Result<B3Digest, super::Error> {
10        Err(Error::Unimplemented)?
11    }
12}
13
14#[derive(thiserror::Error, Debug)]
15pub enum Error {
16    #[error("puts are unimplemented")]
17    Unimplemented,
18}
19
20impl From<Error> for super::Error {
21    fn from(value: Error) -> Self {
22        Self(Box::new(value))
23    }
24}