[][src]Struct ieql::input::document::Document

pub struct Document {
    pub url: Option<String>,
    pub data: Vec<u8>,
    pub mime: Option<String>,
}

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]

Auto Trait Implementations

impl Send for Document

impl Sync for Document

Blanket Implementations

impl<T> From for T
[src]

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom for T where
    T: From<U>, 
[src]

type Error = !

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<T> Any for T where
    T: 'static + ?Sized
[src]