[−][src]Struct ieql::input::document::Document
The Document
struct represents any kind of document, but typically
some sort of Internet document. A Document
can often be quite large;
after all, it contains the entire text of a document.
In practice, this struct functions more as an interim format as data becomes
a CompiledDocument
.
Fields
url: Option<String>
url
represents the URL of the document, if it is present.
For internet documents, this typically takes the form of Some("https://...")
,
whereas for local documents this typically takes the form of
Some("/path/to/file")
.
data: Vec<u8>
data
contains the data of the document.
This data is stored as a Vec<u8>
primarily for first-class text
document support (utf8
).
mime: Option<String>
mime
represents a valid IETF mime
type, as per RFC 2045.
Methods
impl Document
[src]
pub fn domain(&self) -> Option<String>
[src]
This function extracts the hostname (domain name) of a document. In cases where
the host name isn't known, this function returns None
.
Trait Implementations
impl CompilableTo<CompiledDocument> for Document
[src]
fn compile(&self) -> Result<CompiledDocument, Issue>
[src]
Auto Trait Implementations
Blanket Implementations
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From<T> for T
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,