move header parsers to utilities
This commit is contained in:
parent
ea7af860b2
commit
4573bfe7d7
4 changed files with 12 additions and 9 deletions
|
@ -27,15 +27,13 @@ use reqwest::{
|
|||
};
|
||||
use std::hash::Hash;
|
||||
|
||||
mod content_type;
|
||||
use content_type::*;
|
||||
mod link;
|
||||
use link::*;
|
||||
|
||||
use crate::core::*;
|
||||
use crate::headers;
|
||||
use crate::util::http;
|
||||
use crate::util::http::Response;
|
||||
use crate::util::http::{
|
||||
self,
|
||||
header::{content_type::ContentType, link::Link},
|
||||
Response,
|
||||
};
|
||||
|
||||
pub struct CachedLoader<I = IriBuf, M = Span, T = Value<M>> {
|
||||
state: AppState,
|
|
@ -6,6 +6,11 @@ use crate::core::*;
|
|||
use crate::util::slice::SliceCursor;
|
||||
use crate::util::transcode;
|
||||
|
||||
/// Parser for the `Content-Type` header.
|
||||
pub mod content_type;
|
||||
/// Parser for the `Link` header.
|
||||
pub mod link;
|
||||
|
||||
/// Parse an HTTP Structured Field Value according to
|
||||
/// [RFC 8941](https://www.rfc-editor.org/info/rfc8941).
|
||||
///
|
||||
|
|
|
@ -12,7 +12,7 @@ use mime::Mime;
|
|||
use reqwest::header::HeaderValue;
|
||||
use std::str::FromStr;
|
||||
|
||||
use crate::util::http::header::{Item, ParseHeader, ParseOptions};
|
||||
use super::{Item, ParseHeader, ParseOptions};
|
||||
|
||||
/// Helper structure for parsing the `Content-Type` header for JSON-LD.
|
||||
pub struct ContentType {
|
|
@ -12,7 +12,7 @@ use iref::{IriRef, IriRefBuf};
|
|||
use reqwest::header::HeaderValue;
|
||||
use std::str::FromStr;
|
||||
|
||||
use crate::util::http::header::{Item, ParseHeader, ParseOptions};
|
||||
use super::{Item, ParseHeader, ParseOptions};
|
||||
|
||||
pub struct Link {
|
||||
href: IriRefBuf,
|
Loading…
Reference in a new issue