1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
#![cfg_attr(feature="docinclude", feature(external_doc))]
#![cfg_attr(feature="docinclude", doc(include="../README.md"))]

// Re-exports //
pub use async_trait::async_trait;
pub use mongodb;
pub use mongodb::bson;

pub use wither_derive::Model;
#[cfg(any(feature="sync"))]
pub use wither_derive::ModelSync;

// Common //
mod error;
pub use error::{Result, WitherError};
mod common;
pub use common::IndexModel;

// Async //
mod cursor;
pub use cursor::ModelCursor;

mod migration;
pub use migration::{
    IntervalMigration,
    Migration,
};
mod model;
pub use model::Model;

// Sync //
#[cfg(any(feature="sync"))]
mod sync;
#[cfg(any(feature="sync"))]
pub use sync::ModelCursorSync;

#[cfg(any(feature="sync"))]
pub use sync::{
    IntervalMigrationSync,
    MigrationSync,
};
#[cfg(any(feature="sync"))]
pub use sync::ModelSync;

/// All traits needed for basic usage of the wither system.
pub mod prelude {
    pub use crate::migration::{
        Migrating,
        Migration,
    };
    pub use crate::model::Model;
    pub use wither_derive::Model;

    #[cfg(any(feature="sync"))]
    pub use crate::sync::{
        MigratingSync,
        MigrationSync,
    };
    #[cfg(any(feature="sync"))]
    pub use crate::sync::ModelSync;
    #[cfg(any(feature="sync"))]
    pub use wither_derive::ModelSync;
}