refactor taskchampion::server into a module with submodules
This commit is contained in:
@@ -37,6 +37,3 @@ pub use task::{Task, TaskMut};
|
||||
|
||||
/// Re-exported type from the `uuid` crate, for ease of compatibility for consumers of this crate.
|
||||
pub use uuid::Uuid;
|
||||
|
||||
#[cfg(test)]
|
||||
pub(crate) mod testing;
|
||||
|
||||
6
taskchampion/src/server/mod.rs
Normal file
6
taskchampion/src/server/mod.rs
Normal file
@@ -0,0 +1,6 @@
|
||||
#[cfg(test)]
|
||||
pub(crate) mod test;
|
||||
|
||||
mod types;
|
||||
|
||||
pub use types::{Blob, Server, VersionAdd};
|
||||
@@ -1,9 +1,12 @@
|
||||
/// A Blob is a hunk of encoded data that is sent to the server. The server does not interpret
|
||||
/// this data at all.
|
||||
pub type Blob = Vec<u8>;
|
||||
|
||||
/// VersionAdd is the response type from [`crate:server::Server::add_version`].
|
||||
pub enum VersionAdd {
|
||||
// OK, version added
|
||||
/// OK, version added
|
||||
Ok,
|
||||
// Rejected, must be based on the the given version
|
||||
/// Rejected, must be based on the the given version
|
||||
ExpectedVersion(u64),
|
||||
}
|
||||
|
||||
@@ -18,3 +21,4 @@ pub trait Server {
|
||||
|
||||
fn add_snapshot(&mut self, username: &str, version: u64, blob: Blob);
|
||||
}
|
||||
|
||||
@@ -296,8 +296,8 @@ impl TaskDB {
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
use crate::server::test::TestServer;
|
||||
use crate::taskstorage::InMemoryStorage;
|
||||
use crate::testing::testserver::TestServer;
|
||||
use chrono::Utc;
|
||||
use proptest::prelude::*;
|
||||
use std::collections::HashMap;
|
||||
|
||||
Reference in New Issue
Block a user