-
-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
start working towards http connector
- Loading branch information
glendc
committed
Nov 4, 2023
1 parent
f09c395
commit acb418d
Showing
5 changed files
with
51 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
pub struct HttpConnection; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,4 @@ | ||
pub mod service; | ||
|
||
mod conn; | ||
pub use conn::HttpConnection; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,36 @@ | ||
pub use http::Extensions; | ||
|
||
pub trait Extendable { | ||
fn extensions(&self) -> &Extensions; | ||
fn extensions_mut(&mut self) -> &mut Extensions; | ||
} | ||
|
||
impl Extendable for Extensions { | ||
fn extensions(&self) -> &Extensions { | ||
self | ||
} | ||
|
||
fn extensions_mut(&mut self) -> &mut Extensions { | ||
self | ||
} | ||
} | ||
|
||
impl<T> Extendable for http::Request<T> { | ||
fn extensions(&self) -> &Extensions { | ||
self.extensions() | ||
} | ||
|
||
fn extensions_mut(&mut self) -> &mut Extensions { | ||
self.extensions_mut() | ||
} | ||
} | ||
|
||
impl<T> Extendable for http::Response<T> { | ||
fn extensions(&self) -> &Extensions { | ||
self.extensions() | ||
} | ||
|
||
fn extensions_mut(&mut self) -> &mut Extensions { | ||
self.extensions_mut() | ||
} | ||
} |