mirror of
https://github.com/YGGverse/ggemini.git
synced 2026-04-01 01:25:32 +00:00
implement titan and gemini requests in single file
This commit is contained in:
parent
0cb5ff9cbc
commit
6da4c2ed52
5 changed files with 87 additions and 112 deletions
|
|
@ -3,7 +3,7 @@ pub mod request;
|
|||
pub mod response;
|
||||
|
||||
pub use error::Error;
|
||||
pub use request::{Gemini, Request, Titan};
|
||||
pub use request::Request;
|
||||
pub use response::Response;
|
||||
|
||||
// Local dependencies
|
||||
|
|
@ -67,7 +67,7 @@ impl Connection {
|
|||
Some(&cancellable.clone()),
|
||||
move |result| match result {
|
||||
Ok(_) => match request {
|
||||
Request::Gemini(..) => {
|
||||
Request::Gemini { .. } => {
|
||||
Response::from_connection_async(self, priority, cancellable, |result| {
|
||||
callback(match result {
|
||||
Ok(response) => Ok(response),
|
||||
|
|
@ -75,8 +75,8 @@ impl Connection {
|
|||
})
|
||||
})
|
||||
}
|
||||
Request::Titan(this) => output_stream.write_bytes_async(
|
||||
&this.data,
|
||||
Request::Titan { data, .. } => output_stream.write_bytes_async(
|
||||
&data,
|
||||
priority,
|
||||
Some(&cancellable.clone()),
|
||||
move |result| match result {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue