Fixes WASM build

pull/58/head
Tpt 4 years ago
parent 23cc09f481
commit fa068e1e53
  1. 6
      lib/src/sparql/http/dummy.rs
  2. 6
      lib/src/sparql/mod.rs
  3. 1
      lib/src/sparql/service.rs

@ -3,6 +3,7 @@
use crate::error::invalid_input_error;
use http::{Request, Response};
use std::io;
use std::io::BufRead;
pub struct Client {}
@ -11,7 +12,10 @@ impl Client {
Self {}
}
pub fn request(&self, _request: &Request<Option<Vec<u8>>>) -> io::Result<Response<Vec<u8>>> {
pub fn request(
&self,
_request: &Request<Option<Vec<u8>>>,
) -> io::Result<Response<Box<dyn BufRead>>> {
Err(invalid_input_error(
"HTTP client is not available. Enable the feature 'simple_http'",
))

@ -33,9 +33,7 @@ pub use crate::sparql::parser::{Query, Update};
use crate::sparql::plan::{PlanNode, TripleTemplate};
use crate::sparql::plan_builder::PlanBuilder;
pub use crate::sparql::service::ServiceHandler;
use crate::sparql::service::{
EmptyServiceHandler, ErrorConversionServiceHandler, SimpleServiceHandler,
};
use crate::sparql::service::{EmptyServiceHandler, ErrorConversionServiceHandler};
use crate::sparql::update::SimpleUpdateEvaluator;
use crate::store::numeric_encoder::{StrContainer, StrEncodingAware};
use crate::store::{ReadableEncodedStore, StoreOrParseError, WritableEncodedStore};
@ -231,7 +229,7 @@ impl QueryOptions {
#[inline]
#[cfg(feature = "http_client")]
pub fn with_simple_service_handler(mut self) -> Self {
self.service_handler = Rc::new(SimpleServiceHandler::new());
self.service_handler = Rc::new(service::SimpleServiceHandler::new());
self
}

@ -97,6 +97,7 @@ pub struct SimpleServiceHandler {
}
impl SimpleServiceHandler {
#[allow(dead_code)]
pub fn new() -> Self {
Self {
client: Client::new(),

Loading…
Cancel
Save