aboutsummaryrefslogtreecommitdiff
path: root/examples/request_blocking.rs
diff options
context:
space:
mode:
authorFuwn <[email protected]>2024-03-24 14:24:20 +0000
committerFuwn <[email protected]>2024-03-24 14:34:09 +0000
commit3970616451ab4336e37a7ddfdc67f51e01e55926 (patch)
tree6bf9fa01811004ff408ac5da40354bc34ddabc26 /examples/request_blocking.rs
parentfeat(crate): bump version (diff)
downloadgerm-3970616451ab4336e37a7ddfdc67f51e01e55926.tar.xz
germ-3970616451ab4336e37a7ddfdc67f51e01e55926.zip
refactor: module for blocking, default to non-blocking
Diffstat (limited to 'examples/request_blocking.rs')
-rw-r--r--examples/request_blocking.rs26
1 files changed, 26 insertions, 0 deletions
diff --git a/examples/request_blocking.rs b/examples/request_blocking.rs
new file mode 100644
index 0000000..fed1c41
--- /dev/null
+++ b/examples/request_blocking.rs
@@ -0,0 +1,26 @@
+// This file is part of Germ <https://github.com/gemrest/germ>.
+// Copyright (C) 2022-2022 Fuwn <[email protected]>
+//
+// This program is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, version 3.
+//
+// This program is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program. If not, see <http://www.gnu.org/licenses/>.
+//
+// Copyright (C) 2022-2022 Fuwn <[email protected]>
+// SPDX-License-Identifier: GPL-3.0-only
+
+fn main() {
+ match germ::request::blocking::request(
+ &url::Url::parse("gemini://fuwn.me").unwrap(),
+ ) {
+ Ok(response) => println!("{:?}", response),
+ Err(_) => {}
+ }
+}