Skip to content

Commit 8259f77

Browse files
committed
docs(foundationdb): initial commit for documenting Directory
1 parent a1cd366 commit 8259f77

File tree

6 files changed

+343
-277
lines changed

6 files changed

+343
-277
lines changed

foundationdb/src/directory/directory.rs

Lines changed: 0 additions & 247 deletions
This file was deleted.

foundationdb/src/directory/error.rs

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
// Copyright 2018 foundationdb-rs developers, https://github.com/Clikengo/foundationdb-rs/graphs/contributors
2+
// Copyright 2013-2018 Apple, Inc and the FoundationDB project authors.
3+
//
4+
// Licensed under the Apache License, Version 2.0, <LICENSE-APACHE or
5+
// http://apache.org/licenses/LICENSE-2.0> or the MIT license <LICENSE-MIT or
6+
// http://opensource.org/licenses/MIT>, at your option. This file may not be
7+
// copied, modified, or distributed except according to those terms.
8+
9+
//! Errors that can be thrown by Directory.
10+
11+
use crate::error;
12+
use crate::tuple::hca::HcaError;
13+
use std::io;
14+
15+
/// The enumeration holding all possible errors from a Directory.
16+
#[derive(Debug)]
17+
pub enum DirectoryError {
18+
/// missing path.
19+
NoPathProvided,
20+
/// tried to create an already existing path.
21+
DirAlreadyExists,
22+
/// missing path.
23+
DirNotExists,
24+
/// the layer is incompatible.
25+
IncompatibleLayer,
26+
Message(String),
27+
/// Bad directory version.
28+
Version(String),
29+
IoError(io::Error),
30+
FdbError(error::FdbError),
31+
HcaError(HcaError),
32+
}
33+
34+
impl From<error::FdbError> for DirectoryError {
35+
fn from(err: error::FdbError) -> Self {
36+
DirectoryError::FdbError(err)
37+
}
38+
}
39+
40+
impl From<HcaError> for DirectoryError {
41+
fn from(err: HcaError) -> Self {
42+
DirectoryError::HcaError(err)
43+
}
44+
}

0 commit comments

Comments
 (0)