mirror of
https://github.com/TECHNOFAB11/aerosol.git
synced 2025-12-11 23:50:07 +01:00
Initial commit
This commit is contained in:
commit
37a4b43a29
8 changed files with 555 additions and 0 deletions
31
src/lib.rs
Normal file
31
src/lib.rs
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
pub extern crate tt_call;
|
||||
pub extern crate failure;
|
||||
|
||||
mod join;
|
||||
mod parse;
|
||||
mod interface;
|
||||
mod context;
|
||||
|
||||
|
||||
pub trait Provide<T> {
|
||||
fn provide(&self) -> T;
|
||||
}
|
||||
|
||||
pub trait Factory {
|
||||
type Object;
|
||||
fn build() -> Result<Self::Object, failure::Error>;
|
||||
}
|
||||
|
||||
pub trait ProvideWith<T>: Provide<T> + Sized {
|
||||
fn provide_with<E, F: FnOnce(T) -> Result<T, E>>(&self, f: F) -> Result<Self, E>;
|
||||
}
|
||||
|
||||
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
#[test]
|
||||
fn it_works() {
|
||||
assert_eq!(2 + 2, 4);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue