Initial commit
This commit is contained in:
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
|||||||
|
/target
|
||||||
7
Cargo.lock
generated
Normal file
7
Cargo.lock
generated
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
# This file is automatically @generated by Cargo.
|
||||||
|
# It is not intended for manual editing.
|
||||||
|
version = 3
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "kordophone"
|
||||||
|
version = "0.1.0"
|
||||||
10
Cargo.toml
Normal file
10
Cargo.toml
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
[workspace]
|
||||||
|
members = [
|
||||||
|
"kordophone"
|
||||||
|
]
|
||||||
|
resolver = "2"
|
||||||
|
|
||||||
|
[profile.release]
|
||||||
|
lto = "thin"
|
||||||
|
debug = 1
|
||||||
|
incremental = false
|
||||||
8
kordophone/Cargo.toml
Normal file
8
kordophone/Cargo.toml
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
[package]
|
||||||
|
name = "kordophone"
|
||||||
|
version = "0.1.0"
|
||||||
|
edition = "2021"
|
||||||
|
|
||||||
|
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||||
|
|
||||||
|
[dependencies]
|
||||||
12
kordophone/src/api/mod.rs
Normal file
12
kordophone/src/api/mod.rs
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
|
||||||
|
pub trait APIInterface {
|
||||||
|
fn version(&self) -> String;
|
||||||
|
}
|
||||||
|
|
||||||
|
pub struct TestClient {}
|
||||||
|
|
||||||
|
impl APIInterface for TestClient {
|
||||||
|
fn version(&self) -> String {
|
||||||
|
return "KordophoneTest-1.0".to_string()
|
||||||
|
}
|
||||||
|
}
|
||||||
16
kordophone/src/lib.rs
Normal file
16
kordophone/src/lib.rs
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
mod api;
|
||||||
|
|
||||||
|
pub use self::api::TestClient;
|
||||||
|
pub use self::api::APIInterface;
|
||||||
|
|
||||||
|
#[cfg(test)]
|
||||||
|
mod tests {
|
||||||
|
use super::*;
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn test_version() {
|
||||||
|
let client = TestClient{};
|
||||||
|
let version = client.version();
|
||||||
|
assert_eq!(version, "KordophoneTest-1.0");
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user