mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-06-26 10:54:26 +02:00
refactor taskchampion::server into a module with submodules
This commit is contained in:
parent
7cfa27fc7e
commit
549d3b9f6d
5 changed files with 13 additions and 6 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue