oxigraph/sparql/http/
dummy.rs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
//! Simple HTTP client

use std::io::{Empty, Error, ErrorKind, Result};
use std::time::Duration;

pub struct Client;

impl Client {
    pub fn new(_timeout: Option<Duration>, _redirection_limit: usize) -> Self {
        Self
    }

    #[allow(clippy::unused_self)]
    pub fn get(&self, _url: &str, _accept: &'static str) -> Result<(String, Empty)> {
        Err(Error::new(
            ErrorKind::Unsupported,
            "HTTP client is not available. Enable the feature 'http-client'",
        ))
    }

    #[allow(clippy::unused_self, clippy::needless_pass_by_value)]
    pub fn post(
        &self,
        _url: &str,
        _payload: Vec<u8>,
        _content_type: &'static str,
        _accept: &'static str,
    ) -> Result<(String, Empty)> {
        Err(Error::new(
            ErrorKind::Unsupported,
            "HTTP client is not available. Enable the feature 'http-client'",
        ))
    }
}