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
.
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
contains the data of the document.
This data is stored as a Vec<u8>
primarily for first-class text
document support (utf8
).
mime
represents a valid IETF mime
type, as per RFC 2045.
This function extracts the hostname (domain name) of a document. In cases where
the host name isn't known, this function returns None
.
Returns a compiled version of self
, without using self. Importantly, compiling a component will perform a deep clone on that component. Remember: compilation is expensive! Read more
🔬 This is a nightly-only experimental API. (try_from
)
The type returned in the event of a conversion error.
🔬 This is a nightly-only experimental API. (try_from
)
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more
🔬 This is a nightly-only experimental API. (try_from
)
The type returned in the event of a conversion error.
🔬 This is a nightly-only experimental API. (try_from
)
🔬 This is a nightly-only experimental API. (get_type_id
)
this method will likely be replaced by an associated static