Compare commits

..

3 commits

Author SHA1 Message Date
6e1587a159 build: remove unlinked files
UNLINK
2024-11-08 18:55:19 +00:00
8e1af0410c feat(network)!: remove legacy network interface 2024-11-08 18:55:19 +00:00
1443e6dfce feat(net)!: fluent api
Some checks failed
Rust / build (map[name:nightly]) (push) Failing after 37s
Rust / build (map[name:stable]) (push) Failing after 1m26s
Closes kemitix/kxio#43
2024-11-08 18:55:19 +00:00
2 changed files with 5 additions and 7 deletions

View file

@ -1,15 +1,16 @@
//! Provides a generic interface for network operations.
//!
//!
//!
//!
mod result;
mod system;
mod result;
pub use result::{Error, Result};
pub use system::{MatchOn, Net};
use system::{Mocked, Unmocked};
/// Creates a new `Net`.
pub const fn new() -> Net<Unmocked> {
Net::<Unmocked>::new()

View file

@ -43,10 +43,7 @@ async fn test_get_wrong_url() {
net.on(request).respond(my_response.into());
//when
let_assert!(
Err(Error::UnexpectedMockRequest(invalid_request)) =
net.send(client.get("https://some.other.url/")).await
);
let_assert!(Err(Error::UnexpectedMockRequest(invalid_request)) = net.send(client.get("https://some.other.url/")).await);
//then
assert_eq!(invalid_request.url().to_string(), "https://some.other.url/");